[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Re[2]: require ignores setglobals()
- From: "Peter Hill" <corwin@...>
- Date: Fri, 7 Feb 2003 19:43:56 +0800
Luiz Henrique de Figueiredo
> _G is not magical variable.
I was just starting to realise that.
> It's not part of the core; it's provided by the
> base lib for convenience. In other words, global names are *not* resolved
> by indexing _G. They're resolved by indexing whatever getglobals return at
> the time (of course, the core knows about the current global table of the
> current function being executed and does not call getglobals).
So how does one now protect (as Gunnar wanted) submodules against accessing
the standard globals? This sounds like a *big* change from Lua4.
*cheers*
Peter Hill.