If you look at line 487 of table.c,
you will see that Lua already does just as you suggest
with the fasttm cache flags.
I'm going way out on a limb here, but
as far as I know, the admonition only applies to the __mode key
(at least that is the text I found in
the manual); changing the weak mode of a table which already has
elements is likely to lead to undefined
(if not undefinable) behaviour.
So the only issue I can see is that
changing a metatable will clear the cache flags, which may
have some minimal short-term performance
Mark Hamburg <firstname.lastname@example.org> Sent by: email@example.com
03/25/04 09:29 PM
Please respond to Lua list
Size :3 Kb
Lua list <firstname.lastname@example.org>
Changing metatable contents
We've been looking at some data loading issues on
my team, and the issue
that you shouldn't change metatable contents (or at least not which keys
present) has come up. Is there a reason for this admonition other than
artifact of the implementation? Could it be removed by clearing the fasttm
cache flags whenever we set an entry in a table?