|
On Aug 11, 2014, at 11:34 AM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote: [...] The 5.2 ref manual (section 2.2) states “When Lua compiles a chunk it initializes the value of its _ENV upvalue…”. When I was initially studying Lua this did confuse me until I realized that it really means “When Lua LOADS a chunk…” (which of course might also entail compiling it unless a pre-compiled chunk was supplied). When I first read this is seemed to suggest that the compiler was emitting some magic bytecode that, when later loaded, would wire-up _ENV to the global environment. —Tim |