lua-users home
lua-l archive

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

Joe Krahn wrote:
> I'm new to Lua, so maybe there is already something like this.
> If I make my own Lua objects with several Metatable entries, my
> understanding is that I will have to add these entries for every
> object. If I have a lot of these object, that seems wasteful, and adds
> overhead from extra memory accesses. I was thinking, how about having
> a metatable entry called "__inherit", which is just a reference to
> another table, and which is checked if a given entry is not found?
> Joe Krahn
It's called __index.