lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I've studied the Lua inheritance example described in this link:

http://lua-users.org/wiki/InheritanceTutorial

Now my question:

How can I overload the constructor of the simple class in my derived class?

something like this ...

SubClass = inheritsFrom( SimpleClass )

function SubClass:create()
   -- call the super constructor here (?)
   ???

   self.x = 1
   self.caption = "bla"
end


sub = SubClass:create()


Any thoughts or hints are very welcome.

Best Regards
Micha