lua-users home
lua-l archive

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


>>>>> "Dennis" == Dennis Fischer <DarkWiiPlayer@hotmail.com> writes:

 Dennis> As you can see, if a normal upvalue is used before any "global"
 Dennis> variable, _ENV is not the first upvalue. While the reference
 Dennis> manual doesn't really state that _ENV has to be the first
 Dennis> upvalue,

_ENV is guaranteed to be the first (and only) upvalue if what you're
loading is a text chunk, or a binary that is a dumped chunk (e.g. from
luac) and _not_ a dumped function.

If you load a binary that's dumped from a (non-chunk) function, then
figuring out the upvalues is basically up to you.

-- 
Andrew.