public static int lua_absindex(IntPtr luaState, int index) { return index > 0 ? index : lua_gettop(luaState) + index + 1; }