[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Converting setfenv getfenv to Lua 5.2
- From: Finn Wilcox <finnw@...>
- Date: Sat, 30 Nov 2013 19:30:09 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 30/11/2013 17:15, Andrew Starks wrote:
> _ENV is the first upvalue of every scope ...
This is not true. Not every function has an _ENV, and when it is
present it is not always the first upvalue.
For example in this function:
local s = "Hello, world"
local function f()
local s1 = s
print(s1)
end
upvalue #1 is s and upvalue #2 is _ENV.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJSmjzBAAoJEHp3pOlF38H/vUgH/0m8896qhmI4fhTd1EWEELne
WuHlQWB1TjgLQLcNTWyc9JsfJNp0UO4zO7oOqhBnoaeyeKhSBuuHbS6830suzRNS
WHFLxGN0xADYiwPG/BQwmYq42WIoosQhPHQpFAUiioi620IxxIEIYVpl3XIH65Nx
Oh/mP5LDt8IIf6/pdXTGTotRqPFlurytJ+hQqoR6VdnGjXeoidPsGCAvWeljSpgb
E/RGU0Fp54b+5ZnkfOgOdEdUf197JOgWlqgiLI2bLKS1bzmeJ/clxlBK7lG7gYx+
IfjP2ZG9sYUbqvyv3N2x6Kduru6quMZrMWRvw0wYq8ka+3VvKr5q5vZYHvATF3c=
=Ac8b
-----END PGP SIGNATURE-----