lua-users home
lua-l archive

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

On Wed, Nov 20, 2013 at 7:31 AM, Daurnimator <> wrote:
On 20 November 2013 12:22, Sir Pogsalot <> 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.

Thanks, I just used lua_next as in my original posting, it works fine, just wondering if I was not seeing a better way.