[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: _ENV and chunks
- From: Robert Virding <rvirding@...>
- Date: Mon, 2 Jun 2014 03:10:07 +0200
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.