[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: a new proposal for environments
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 25 Feb 2010 09:54:03 -0300
> David Given wrote:
> >Hmm. If I'm *not* using globals, can I assign nil to _ENV to get
> >runtime errors if I tyop the name of a local?
> >
> >local string_len = string.len
> >_ENV = nil
> >a = 5 -- oops, forgot to local this
>
> What about functions? If I understood correctly, they too will be
> defined as fields of _ENV, as currently happens with _G.
>
> (but I'm not sure I got the details right)
There are no hidden details; just follow rules (1) & (2). That is what
the compiler will do.
-- Roberto