[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua Programming Gems now available at Amazon
- From: "Duncan Cross" <duncan.cross@...>
- Date: Mon, 15 Dec 2008 21:24:52 +0000
I am very glad to see this. Thank you, to everyone involved.
I've already learned something new from reading through Roberto's - in the middle of a pairs()/next() loop, it is no problem to change the *current* key in the table (previously I had believed that tables should not be modified at all when traversing them). Setting a different key may cause the loop to terminate early if you are setting the value to nil, or trigger a rehash if it is not. But setting the current key to something else, including nil, should always be fine. Is that right?
(Apologies if this was actually covered in the PiL or something.)