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!,
vertexar.


--- Rici Lake <lua@ricilake.net> 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
www.darkdesigns.com.ar
Sign our Guestbook!

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com