lua-users home
lua-l archive

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


On Fri, Jan 15, 2010 at 12:30 AM, David Given <dg@cowlark.com> wrote:
> Actually, what I'd really like is a syntactic construction indicating
> that a particular lexical scope has *no* environment and any use of
> globals is therefore an error and should error out at compile time.
>
> local a = 1
> in nil do
>  a = 2 -- works
>  b = 3 -- fails at compile time!
> end

Couldn't nil conceivably have __index and __newindex metamethods at
run time, and therefore this would *have* to compile?

-Duncan