[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua hacking wondering
- From: "Adam D. Moss" <adam@...>
- Date: Tue, 22 Jun 2004 20:19:47 +0100
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
--
Adam D. Moss . ,,^^ adam@gimp.org http://www.foxbox.org/ co:3