[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Converting setfenv getfenv to Lua 5.2
- From: Andrew Starks <andrew.starks@...>
- Date: Sat, 30 Nov 2013 14:45:15 -0600
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