[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.2 (was: modules, require, magic)
- From: Petite Abeille <petite.abeille@...>
- Date: Wed, 19 Oct 2011 21:02:36 +0200
On Oct 19, 2011, at 8:48 PM, Patrick Donnelly wrote:
> The _ENV griping is a real joke to be honest. Everything you used to
> do you can still do.
Right. Requires a bit of a rethink, but yes, _ENV is a workable substitute for setfenv() .
> Moving the environment to an upvalue makes sense
> and is quite elegant. People are just mad their silly designs that
> relied on heavy use of setfenv are "broken".
Well, the use of setfenv is not necessarily silly. It's just that the mechanism would have to change in 5.2.
> They will grow up
Again, using setfenv is not, hmmm, infantile... it's a mechanism that serves a purpose... same as _ENV...
> or use debug.setupvalue.