[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: Matthew Wild <mwild1@...>
- Date: Sat, 9 Jan 2010 23:48:08 +0000
2010/1/9 Cosmin Apreutesei <cosmin.apreutesei@gmail.com>:
>> Actually, I'd love to hear the official "motivation" behind this feature.
>> New syntax constructs are rarely introduced in Lua, and this one was
>> dropped like a bomb, without any warning.
>
> Regardless of motivation, there's a technical limitation of current
> function environments that lexical environments are solving, and it
> can only be solved by introducing new syntax (it's gotta be a lexical
> thing). Currently you can't have the same function in two environments
> at the same time.
Well you can. I guess you mean a function can't have 2 environments at
the same time. My understanding is that it still can't.
"in env do <code> end" is (I believe) simply equivalent to:
setfenv(function () <code> end, env)()
Matthew
- References:
- Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Patrick Donnelly
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Mark Hamburg
- Re: Lua registry, environment, and threads., Patrick Donnelly
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Alexander Gladysh
- Re: Lua registry, environment, and threads., Cosmin Apreutesei