Check out Dart's iterators

Jason Orendorff jason.orendorff at
Mon Feb 11 13:33:34 PST 2013

On Mon, Feb 11, 2013 at 12:30 PM, Oliver Hunt <oliver at> wrote:

> Saving the cost of "generator overhead" by making all iteration
> technically slower by depending on exceptions (correct semantics mean even
> optimising out the throw is tricky for default iteration generators).

We are epicly talking past each other in this thread, but if you're saying
that the raw iterator protocol will rarely be used by developers, no

For now I would say that we shouldn't expose the internal implementation
> behaviour of yield (which is what being able to explicitly create or call a
> generator produces).  That fairly trivially resolves the StopIteration
> behaviour by pushing it out of the ES6 spec.  If there's enough demand for
> manually creating or 'calling' a generator then we can fix it in ES6.x/7

Can you be more concrete? Generator-iterators must at least be first-class
values that can be created and then passed around.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list