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, it would be nice if lua_newtable
would return the stack index of the table that it just created.

lua_newtable(L);  names = lua_gettop(L);  /* do away with call to
lua_gettop */
lua_pushstring(L, "bill");
lua_pushnumber(L, 44);
lua_settable(L, names);

- Peter