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.

On Tue, May 18, 2010 at 7:51 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> Lua 5.2.0 (work3) is now available at
>        http://www.lua.org/work/lua-5.2.0-work3.tar.gz
>
> MD5     fa529ad323d261f27c12b04e3fef96a7  -
> SHA1    5065a02a373500f62c7b87a89e5574d63dfa53e9  -
>
> This is a work version. All details may change in the final version.
>
> Here are the main changes since the previous work version:
> - new _ENV proposal
> - generational collector (very experimental)
> - light C functions
> - order tag methods follow the same rules of other binary operators
> - lua_absindex
> - \0 in patterns
> - empty statement
> - options in io.lines
>
> The manual has been updated and most glitches reported in work2 have been fixed.
> The complete diffs are available at
>        http://www.lua.org/work/diffs-lua-5.2.0-work2-work3.txt
>
> (This is a very large diff because the manual has been rearranged.)
>
> All work versions are available at
>        http://www.lua.org/work/
>
> All feedback welcome. Thanks.
> --lhf
>
>