lua-users home
lua-l archive

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


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