LUA_REGISTRYINDEX、LUA_ENVIRONINDEX、 LUA_GLOBALSINDEX是一个假索引(pseudo-indices),一个假索引除了他对应的值不在栈中之外,其他都类似于栈中的索引。 Lua API 中大部分接受索引作为参数的函数,其实可以理解为一张普通表格,你可以使用任何非nil的Lua值来访问她的元素。 The Registry Lua 提供一个独立的被称为 ...
问lua_newthread() & LUA_REGISTRYINDEX独立性EN这是一个很简单的问题,但这是gotchas.So。上一篇文章...
The assert inlua_rawsetiwas changed because theLUA_REGISTRYINDEXtable is not on the stack, so the stack can contain just the value that will be set inside the table. lua_tointegerappears to work a bit differently in C Lua and Fengari: ...