[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work4) now available
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 3 Aug 2010 09:12:06 +0200
On Tue, Aug 3, 2010 at 7:57 AM, Geoff Leyland <geoff_leyland@fastmail.fm> wrote:
> Bytecode equivalence aside, couldn't you achieve this with:
>
> local _ENV = setmetatable({}, { __index = _G}) -- or is that __index=_ENV now?
> function foo() bar() end
> function bar() print'!' end
> return setmetatable(_ENV, nil)
This wouldn't work, because if M.bar() is called later, the
environment will have been altered and print will not be resolved.
- References:
- Re: [ANN] Lua 5.2.0 (work4) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.0 (work4) now available, Florian Weimer
- Re: [ANN] Lua 5.2.0 (work4) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (work4) now available, phlnc8
- Re: [ANN] Lua 5.2.0 (work4) now available, Jim Whitehead II
- Re: [ANN] Lua 5.2.0 (work4) now available, phlnc8
- Re: [ANN] Lua 5.2.0 (work4) now available, Quae Quack
- Re: [ANN] Lua 5.2.0 (work4) now available, GrayFace
- Re: [ANN] Lua 5.2.0 (work4) now available, James Graves
- Re: [ANN] Lua 5.2.0 (work4) now available, Jerome Vuarand
- Re: [ANN] Lua 5.2.0 (work4) now available, David Manura
- Re: [ANN] Lua 5.2.0 (work4) now available, Geoff Leyland