lua-users home
lua-l archive

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

On Apr 30, 2013, at 12:47 AM, Philipp Janda <> wrote:

> Am 29.04.2013 23:31 schröbte Petite Abeille:
>> But… _ENV is not the global environment... _G is.
> To figure out which environment should be considered a "global" environment would require some convention like: only environments passed to one of the load* functions are global environments, or any environment that contains (most of) the Lua standard library is a global environment, or if there's a field _ENV._G that refers back to _ENV, then _ENV is considered a global environment.

Nah. _G is always at LUA_RIDX_GLOBALS. And that is that.

> But all this can only be checked at runtime anyway:

Most likely yes. 

R.I.P. byte code analyzes for globals in 5.2. Oh, well...