[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Recipe: setfenv with Lua 5.2.0 work3
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 21 May 2010 13:31:13 -0300
> a, b = foo()
> setfenv(a, {x=2})
> b()
>
> Does that print 1 or 2?
Neither: it gives an error: attempt to call global 'b' (a nil value).
If you make a,b local, then it does print 2.