[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Explanation needed for setfenv replacement for Lua 5.2
- From: steve donovan <steve.j.donovan@...>
- Date: Sat, 7 May 2011 09:26:27 +0200
On Fri, May 6, 2011 at 10:05 PM, Lorenzo Donati
<lorenzodonatibz@interfree.it> wrote:
> in the end? Or am I missing something?
You are missing nothing here. The notation just seemed very cute.
(the env() function could also ensure that we also look up in the
enclosing environment, so it would not be necessary to use print=print
in the table.)
Note also that this kind of one-shot iterator could do something
interesting on the start of the second iteration before returning nil,
like finalizers.
steve d.