lua-users home
lua-l archive

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


On 2010-01-09, steve donovan <steve.j.donovan@gmail.com> wrote:
>
> debug.setfenv still works as expected in this context:
>
>  Lua 5.2.0 (work1)  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>  > require 'debug'
>  > fn,e = loadstring 'return a + b'
>  > debug.setfenv(fn,{a = 1, b = 10})
>  > = fn()
>  11
>

If I am not mistaken the official position of the Lua development team
is that debug library is intended for *debug* purposes. debug.setenv
does not have the same standing in the Lua API as _G.setenv for
non-debug uses and could disappear in future Lua versions.

--Leo--