Re: a new proposal for environments
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: a new proposal for environments
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2010年2月25日 11:40:11 -0300
> > _ENV is a real variable in all senses. We though about using _G, but
> > that would create a needless incompatibility for code that manipulates
> > _G. Apart from that, _G is as good a name as any other.
>
> It seems a pity to have two names for essentially the same thing.
They're not at all the same thing: changing _G has no effect, whereas
changing _ENV does. _G is just the default value for _ENV in chunks
loaded with load. More precisely, the default value is the table of
globals, which happens to be the starting value of _G.