lua-users home
lua-l archive

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


At 16.21 17/05/2003 +0200, you wrote:
trust.no.one wrote:


You can define "inheritance chains" by setting another proto table on the
account_proto.

Instead of using a table for the __index field you can also use a function.
So there are many ways to build your own "class system".

Keep in mind that __index is only consulted if a field is not present in the
table itself.  The same holds for __newindex.

tnx now I understand how __index work,but in wich way I can do this in c++?
I can do a chain of metatable(in some way) or I must write a function that retrive the father metatable and search for methods? I am working on luna template that i find in the wiki that set __index whit the methodtable
...
lua_pushliteral(L, "__index");
lua_pushvalue(L, methodtable);
lua_settable(L, metatable);
...
Can I set for example __index of the methodtable whit the methodtable of the father?

Sorry for my English.

Iuri Pessina (Italy)




--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Vuoi una ricetta molto interessante per i tuoi risparmi?
Ti serve la zucca di Conto Arancio.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=666&d=18-5