lua-users home
lua-l archive

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


Title: Re: Changing metatable contents
Thank you. I had misremembered the admonition.

Mark

on 3/25/04 8:04 PM, RLake@oxfam.org.pe at RLake@oxfam.org.pe wrote:


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 impact.

R.