lua-users home
lua-l archive

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

Indeed, but, don't you know what kind of undefined
behavior can i get?. (maybe something like iterate
elements that i already visit, or something like that)

Thanks for your reply!,

--- Rici Lake <> wrote:

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

Dark Designs
Sign our Guestbook!

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around