[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: Mark Hamburg <mark@...>
- Date: Thu, 7 Jan 2010 11:09:06 -0800
What are the expected use cases for in env do ... end? As I'm understanding it, it basically just saves writing env.name for various reads and writes at the expense of losing access to other globals unless they are provided by env. So, it could be implemented as:
do
local _env = env
... code with global accesses modified to reference _env ...
end
Is this a correct understanding? That would seem to make sense as a syntactic replacement for some of the setfenv tricks but those tricks seem like tricks much of the time as opposed to particularly clean ways to write things. See the discussions about issues with the module function and package.seeall, for example.
Mark
- References:
- 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., Mark Hamburg
- Re: Lua registry, environment, and threads., Mark Hamburg
- Re: Lua registry, environment, and threads., steve donovan
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy