lua-users home
lua-l archive

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


On Thu, May 20, 2010 at 5:38 PM, Enrico Colombini <erix@erix.it> wrote:
>  do local _ENV = e;  f() end

That doesn't execute f() in the context of e (nor did the old "in e do
f() end"). _ENV is a local/upvalue like any other, hence declaring a
new local called _ENV will not affect any functions declared outside
the scope of the local. I suspect you want to use debug.setupvalue
instead.