lua-users home
lua-l archive

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


Reading through the manual I have understood that:

- _ENV is an upvalue to a chunk and not an argument to the chunk function
- It is the only upvalue to the chunk

Am I correct here? There is a slightly cryptic section in the documentation of load which has me puzzled:

"If the resulting function has upvalues, the first upvalue is set to the value of the global environment or to env, if that parameter is given. When loading main chunks, the first upvalue will be the _ENV variable (see §2.2)."

I am assuming that the resulting function is the chunk function.

Robert