lua-users home
lua-l archive

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


On Sat, Nov 30, 2013 at 2:37 PM, Andrew Starks <andrew.starks@trms.com> wrote:
> Without `env` set, it defaults to the current value of _ENV.

I screwed up. It defaults _ENV to the global environment. Sorry about that.

@Finn: I thought it was always first, but no matter. It's always
"there", even if it is set to nil or a string or a table.

Also, Georgios, the nice thing about _ENV is that it applies to any
chunk, not just a function:

do
local assert = assert
_ENV = {}
assert(print == nil)
end

Anyway, I mostly wanted to clear up my error.

-Andrew