[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Bug in 5.3 ipairs(), or feature?
- From: Tom N Harris <telliamed@...>
- Date: Wed, 04 Mar 2015 16:21:47 -0500
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.