[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: pair()-like iterator in C++
- From: "Rici Lake" <lua@...>
- Date: Wed, 2 May 2007 16:43:46 +0100 (BST)
Leandro Pelorosso wrote:
> Can I add new rows to the table while I iterate over
> all the key-value pairs?
Not if you iterate with pairs() (or lua_next):
"The behavior of next is undefined if, during the traversal, you assign
any value to a non-existent field in the table. You may however modify
existing fields. In particular, you may clear existing fields."
(from the Reference Manual)