[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 alternative for "while (lua_next(L, LUA_GLOBALSINDEX) != 0) {"
- From: Patrick Donnelly <batrick@...>
- Date: Mon, 19 Nov 2012 03:23:44 -0500
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) {
}
lua_pop(L, 1);
[I'm partial to the for loop construction myself.]
On Mon, Nov 19, 2012 at 3:16 AM, Joop Boonen <joop_boonen@web.de> wrote:
> Hi,
>
> Does anyone which alternative Lua 5.2 code can be used for:
>
> while (lua_next(L, LUA_GLOBALSINDEX) != 0) {
>
> Is the following an option?
>
> while (lua_next(L, LUA_RIDX_GLOBALS) != 0) {
>
> Regards,
>
> Joop.
>
>
--
- Patrick Donnelly