[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Overloading constructor in Lua inheritance example ?
- From: Michael Bauroth <Michael.Bauroth@...>
- Date: Wed, 14 Jan 2009 12:43:05 +0100
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