lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.