lua-users home
lua-l archive

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


> In section 8.3 of the manual, the following two (adjacent) lines seem
> rather contradictory:
> # Pseudoindex LUA_ENVIRONINDEX was removed. C functions do not have
> environments any more. Use an upvalue with a shared table if you need
> to keep shared state among several C functions. (You may use
> luaL_openlib  to open a C library with all functions sharing a common
> upvalue.)
> # Macros lua_getglobal, lua_setglobal, and lua_register now operate
> over the function environment instead of the global environment. (This
> is more consistent with how Lua manipulates global variables.)
> 
> As far as I can tell, the second of these lines is incorrect - those
> three functions all use LUA_RIDX_GLOBALS, which is the global
> environment.

Right. Many thanks for the correction.

-- Roberto