Stuff
public text v1 · immutable /* data we save */
lua_newtable(L);
lua_rawget(L,LUA_GLOBALSINDEX);
lua_pushnil(L);
while (lua_next(L,-2) != 0) {
/* table, global table, key, value */
switch (lua_type(L, -1)) {
case LUA_TNUMBER:
case LUA_TBOOLEAN:
case LUA_TSTRING:
lua_pushnumber(L,i++);
/* table, global table, key, value, value2 */
lua_settable(L,-5);
/* table, global table, key */
default:
continue;
}
}