lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> 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