lua-users home
lua-l archive

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


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.