lua-users home
lua-l archive

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




On 04/03/15 06:21 PM, Tom N Harris wrote:
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.

But that's for next, not ipairs()?

--
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.