lua-users home
lua-l archive

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


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

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"

sub = SubClass:create()

Any thoughts or hints are very welcome.

Best Regards