Check out Dart's iterators

David Bruant 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 
>> implementation.
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 
>> included
That's the only part I disagree with and my answer applied to.

I wrote:
> But we do not live in the "endframe as"+"completion" world. "throw 
> StopIteration" is probably as close as we can get in JavaScript given 
> 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 
that JavaScript has, so I agree with Mozilla's implementation and 
bringing its design to ES6.

I apologize for the confusion.

David


More information about the es-discuss mailing list