Check out Dart's iterators
bruant.d at gmail.com
Sun Feb 10 07:50:50 PST 2013
Le 10/02/2013 16:21, David Bruant a écrit :
> Le 10/02/2013 13:21, Alex Russell a écrit :
>> FWIW, there continue to be strong misgivings about the pythonesqe
>> design we have now, but Mozilla insists on the back of their shipping
I have made a mistake in keeping that part of the quote in my reply. I
actually disagree with this statement.
>> Many feel that exceptions for control-flow are a missdesign, myself
That's the only part I disagree with and my answer applied to.
> But we do not live in the "endframe as"+"completion" world. "throw
> the 3 way to complete a frame that we have (return/throw/yield). If
> anything, it's very explicit about what it does ("stop iteration").
> More than a return true/false protocol.
As I said at the end of my reply, "throw StopIteration" is probably the
best thing that can be designed given the backward-compat constraints
bringing its design to ES6.
I apologize for the confusion.
More information about the es-discuss