[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Newbe question on function environment
- From: Duncan Cross <duncan.cross@...>
- Date: Sun, 1 Apr 2012 12:27:24 +0100
On Sun, Apr 1, 2012 at 10:58 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> (...)
> 2. Whenever you enter a function, Lua has pre-initialized _ENV
> for you, so that _ENV and _ENV._ENV are the same.
> (...)
Hmm, I think this bit is a possible point of confusion. A reference to
_ENV is not itself a global variable access equivalent to _ENV._ENV,
it's just a local variable access. So there's no reason _ENV._ENV
would be set to anything.
-Duncan