[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Metatables
- From: "Wim Couwenberg" <w.couwenberg@...>
- Date: Thu, 9 Jan 2003 15:22:12 +0100
Hi,
A small note on my previous posting:
> local myclass_meta = {
> __index = function(_, index) return myclass_proto[index] end,
> }
Hmm. That's just a Lua 4 habit of mine... In Lua 5 you can write:
local myclass_meta = {
__index = myclass_proto,
}
And of course you can build "hierarchies" by setting a metatable on
myclass_proto itself.
Bye,
Wim