[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Metatable inheritance
- From: Joe Krahn <jkrahn@...>
- Date: Sat, 07 Apr 2007 12:45:05 -0400
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?