[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Recipe: setfenv with Lua 5.2.0 work3
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 20 May 2010 13:27:55 -0300
> It's a question of how much sugar a person needs, but
>
> in t do x = 10; y = 20 end
>
> seems easier to read than
>
> do local _ENV = t; x = 10; y = 20 end
Surely it is.
In these discussions in the list, sometimes it looks like people are
changing environments all the time, in all sorts of code. I may be
very wrong, but my impression is that changing the environment is
seldom done, mainly (only?) in the setup of a module or when running
untrusted code. I would like it to look "ugly", to be easily seen
and found (e.g., "/_ENV"), not to look like "code as usual".
-- Roberto