lua-users home
lua-l archive

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


On 20 November 2013 12:22, Sir Pogsalot <sir.pogsalot@gmail.com> wrote:
I might instead use luaL_len() from the auxiliary lib, but perhaps it does the same thing -- as most of those luaL functions are macros or functions that perform a series of operations accomplished with the lua_ functions.

Afaik luaL_len() does not push anything on the stack, it just returns an int for the length of the object.  It probably calls lua_len() then pops that value and returns int (lua_tointeger()).

-peace-  :]
 
next (and lua_next) also work for non-sequence tables.

To the OP, AFAIK, using lua_next is correct here.