On 7 March 2013 22:30, Erik Arvidsson <[email protected]> wrote:
> One more thing worth pointing out is that a singleton does not work
> due to "return e" in generators needs to signal an end to iteration
> with a value. The wiki does this be creating a new object with a
> "value" property and [[Class]] set to "StopIteration"

Yes, to clarify, I did not talk about using a singleton, but about a
an instance of the StopIteration class, just like in the wiki.

> Instead of returning a singleton we can return an object with two
> fields, {value: v, done: b} and when we see a "return e" in a
> generator this becomes {value: e, done: true}.

Sure, if there is hope for getting consensus on an Either-type like
approach, then I would definitely prefer that over what I suggested!

/Andreas
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to