lua-users home
lua-l archive

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


On 1/19/07, Rici Lake <lua@ricilake.net> wrote:
By the way, be careful with recursively enumerating tables; if there's
a circular reference, you'll find yourself running off the end of the C
stack. (And, since _G._G == _G, there is such a circular reference in
the standard globals table.)

One thing I found interesting (my original code seems to work by the
way, just don't use lua_tostring on the key) is that it never
enumerates the _G._G circle.  It seems to work as expected,
enumerating everything else and then exiting without entering a
infinite loop.

CR