On Apr 24, 2014, at 11:08 AM, Jason Orendorff wrote:

> On Tue, Apr 15, 2014 at 10:24 AM, Andreas Rossberg <[email protected]> 
> wrote:
>>> JH: Iterators are claiming to Iterables, which is a lie.
>> 
>> I argued this very point in the past (after a discussion with Dmitry),
>> but wasn't very successful:
>> 
>> https://mail.mozilla.org/pipermail/es-discuss/2013-March/029004.html
>> 
>> I agree with you on this point, and still think that the current
>> iterator/iterable model is rather incoherent and the iterable concept
>> thus not really useful -- you cannot reliably write abstractions based
>> on it.
> 
> Python has the same "incoherent" model and people constantly write
> abstractions based on iterables in Python.
> 
> Iterators are claiming to be iterables, which is true. They are
> iterable. You can iterate over them. It has well-defined behavior and
> a lot of programs do it.
> 
> It's disappointing to see arguments in TC39 notes and on es-discuss
> that are contradicted in the clearest possible way by ten years of
> experience in a widely used language.

I also, as a Smalltalker, with this "incoherent" model.  But I think talk of 
changing it is a distraction from the real issue.  At the TC39 meeting the 
attendees pretty strongly put aside Jafar's suggestion to change the current 
@@interator model.  What we did take seriously was the concern about not 
running generator finally blocks when a for-of initiated generator has an early 
exit. We don't need to redefine @@iterator conventions to address that issue.

Allen

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

Reply via email to