lua-users home
lua-l archive

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

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