lua-users home
lua-l archive

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


>Since lua_newtable currently doesn't return anything, and it is fairly
>common to call lua_gettop afterwards so that the stack index of the
>table can be passed to lua_settable

The use of negative indices is indicated here. You example would read:

 lua_newtable(L);
 lua_pushstring(L, "bill");
 lua_pushnumber(L, 44);
 lua_settable(L, -3);

--lhf