Re: Derive C++ Class in Lua
Daniel Wallin <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jun 24, 2010 at 12:38:24AM -0700, Emmanuel Barroga wrote:
> I am trying to derive my base class in Lua. My code in Lua looks like this:
>
> class 'square' (shape)
> function square:__init()
> print("Square constructor")
> shape:__init()
This should be:
shape.__init(self)
Ideally this would have failed with some nice error message, but
currently no checking is done on the "self" argument to the constructor.
HTH,
--
Daniel Wallin
BoostPro Computing
http://www.boostpro.com
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first