lua-users home
lua-l archive

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

On Wednesday, March 04, 2015 04:47:22 PM Soni L. wrote:
> So you can't change the metamethods (e.g. add __index) while iterating?

Adding a metatable doesn't work. Removing it seems to work.

The caveat on next says you can't assign to keys that did not already exist. 
Adding an __index metatable is essentially doing this: a key that would have 
returned nil before now returns non-nil.

tom <>