Questions/issues regarding generators

Andreas Rossberg rossberg at google.com
Thu Mar 7 08:43:59 PST 2013


On 7 March 2013 17:29, Claus Reinke <claus.reinke at talk21.com> wrote:
> How about lifting the result, to separate yielded objects and end
> iteration signalling?
>
>    { yields: obj }    // iteration yields obj
>    {} // iteration ends

Yes, that would be the proper encoding of an Option/Maybe type, which
in the abstract is the ideal (the end object might carry a return
value, though).

However, I did not propose that because some around here would
probably be unhappy about the extra allocation that is required for
every iteration element under this approach.

/Andreas


More information about the es-discuss mailing list