lua-users home
lua-l archive

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


Hi guys,

Some functions already return the type retrieved like lua_getuservalue, lua_getglobal. It would be nice to have the same behavior for lua_getfield. So one can easily do:

if (lua_getfield(L, -2, "x") == LUA_TNUMBER)
    x = lua_tointeger(L, -1);
lua_pop(L, 1);

Kind regards,
David.