[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.2 and 5.1
- From: Hisham <h@...>
- Date: Tue, 16 Apr 2013 11:35:08 -0300
On 16 April 2013 08:59, Philipp Janda <siffiejoe@gmx.net> wrote:
> at the top of the file anyway, and some people have written setfenv[1][2][3]
> for Lua 5.2 and I feared that one of those functions could end up in the
> global environment, or -- even worse -- that someone wrote a completely
> unrelated function with that name, since the name setfenv is fair game now
> in Lua 5.2.
It's no more fair game now than it was before: nothing stops anyone
from redefining any globals. (They're not protected like keywords, of
course.)
That's why what I always wanted from the module system, instead of the
wild-west of package.seeall, was a way to get a guaranteed "reset"
environment (like a 'package.seebase' of sorts) with only the standard
Lua globals. If Lua can construct a default environment for the main
chunk and populate the standard libraries there, I figure it could
just as well do the same for modules, to ensure that module authors
can work with a stable set of assumptions about the environment, just
like script writers do.
-- Hisham
http://hisham.hm/
- References:
- Re: 5.2 and 5.1, Dirk Laurie
- Re: 5.2 and 5.1, steve donovan
- Re: 5.2 and 5.1, Dirk Laurie
- Re: 5.2 and 5.1, steve donovan
- Re: 5.2 and 5.1, Dirk Laurie
- Re: 5.2 and 5.1, Petite Abeille
- Re: 5.2 and 5.1, Pierre-Yves Gérardy
- Re: 5.2 and 5.1, Petite Abeille
- Re: 5.2 and 5.1, Pierre-Yves Gérardy
- Re: 5.2 and 5.1, steve donovan
- Re: 5.2 and 5.1, Roberto Ierusalimschy
- Re: 5.2 and 5.1, Petite Abeille
- Re: 5.2 and 5.1, Philipp Janda
- Re: 5.2 and 5.1, Petite Abeille
- Re: 5.2 and 5.1, Philipp Janda
- Re: 5.2 and 5.1, Hisham
- Re: 5.2 and 5.1, Philipp Janda
- Re: 5.2 and 5.1, Miles Bader
- Re: 5.2 and 5.1, Philipp Janda