[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __index
- From: "trust.no.one" <trust.no.one@...>
- Date: Sun, 18 May 2003 09:13:47 +0200
At 19.14 17/05/2003 -0400, you wrote:
Wim Couwenberg wrote:
trust.no.one wrote:
Can I set for example __index of the methodtable whit the methodtable
of
the father?
Not quite. You should set the __index of the _metatable_ of the
methodtable. (Otherwise __index will be treated as an ordinary field.) But
maybe this is what you meant above?
Here is an improved version of Luna for Lua 5.0 that gives a metatable to
the method table. Also the method table is put in the table of globals to
make it easy to access from scripts. The __call metamethod is set to the
'new' method so that your scripts can still call the constructor as
Account(100). This is the same as Account:new(100).
Note the new version is called Lunar.h and it should be compatible with Luna.h
http://lua-users.org/wiki/CppBindingWithLunar
thank you very much
I try with lunar.
- Peter Shook
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Non sai cosa regalare? Vai su Artefiori, il Portale del Verde!
clicca qui:
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=548&d=18-5