[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Using lexical environments (was setfenv/getfenv)
- From: Tony Finch <dot@...>
- Date: Tue, 12 Jan 2010 19:34:39 +0000
On Tue, 12 Jan 2010, Nevin Flanagan wrote:
> My biggest concern remains the challenge of getting values in or out of
> an "in" block. Right now the only ways to get a value out are to either
> extract it from the environment table or create a local before the block
> where it can leave its result; is there any hope for a way to pass
> values in and out via the stack, much as coroutine.resume and
> coroutine.yield do?
What's wrong with wrapping the block in a function?
> This would also help us solve the problem of wrapping code that is not
> informed about a specialized environment but expects arguments:
in (...) do return (function (...)
end)(select(2, ...)) end
f.anthony.n.finch <email@example.com> http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.