Re: Derive C++ Class in Lua

Nigel Atkinson <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <1277675632.1375.19.camel@rincewind>
Hi Emmanuel,

b.area(self)
and 
b:area()

are only the same if b == self, which  is not always the case, and in a
constructor they are not.  As far as Lua is concerned, "self" is just a
variable. It is not treated specially. You could use "this", or "me", or
anything you like instead.

HTH,

Nigel

On Sun, 2010-06-27 at 14:23 -0700, Emmanuel Barroga wrote:

> Thank you, it works now... but aren't the following two equivalent:
> 
> b.area(self)
> b:area()
> 
> 
> The first does not work.
> 
> 
> On Sun, Jun 27, 2010 at 2:19 PM, Daniel Wallin <[email protected]>
> wrote:
> 
>         On Sun, Jun 27, 2010 at 02:11:43PM -0700, Emmanuel Barroga
>         wrote:
>         > Now, I receive the following error:
>         > No matching overload found, candidates:void
>         __init(luabind::argument const&)
>         
>         
>         
>         Are you sure you used:
>         
>          shape.__init(self)
>               ^
>               Note . not :
>         
>         --
>         
>         
>         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
>         _______________________________________________
>         luabind-user mailing list
>         [email protected]
>         https://lists.sourceforge.net/lists/listinfo/luabind-user
>         
> 
> 
> 
> 
> -- 
> Regards,
> Emmanuel Barroga
> 
> 
> 
> ------------------------------------------------------------------------------
> 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
> _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user

------------------------------------------------------------------------------
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

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.