lua-users home
lua-l archive

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

Dimitris Papavasiliou wrote:
This is the impression I'm under as well, but I was wondering: since these entries in the metatable (the metamethods that is) are used by the VM it wouldn't be too ugly to keep a number of flags with each table/userdata for storing wich (of the "standard") metamethods have been set in it's metatable. Then every time, say, an index operation takes place all you have to do is check if the index flag is set (a very cheap operation) instead of looking up the metatable and indexing it.

Actually I think this is roughly how it's implemented in reality.

Adam D. Moss   . ,,^^   co:3