The ES6 iteration protocol

Dmitry Soshnikov dmitry.soshnikov at gmail.com
Mon Apr 6 20:23:46 UTC 2015


I guess all built-in iterators return themselves for `Symbol.iterator`
protocol. So they are all "singletons". I described in detail where
confusion/substitution of concepts happens in that analysis in the recent
two comments.

Dmitry

On Mon, Apr 6, 2015 at 1:07 PM, joe <joeedh at gmail.com> wrote:

> Regardless of what the spec says, you cannot avoid singleton iterators in
> real-world code.  In my opinion, the spec should refrain from specifying
> when object creation happens within the iteration protocol, wait for the
> relevant code and contract patterns to develop and then include something
> in ES7.
>
> On Sun, Mar 29, 2015 at 12:08 AM, Dmitry Soshnikov <
> dmitry.soshnikov at gmail.com> wrote:
>
>> Good write up, although "fresh vs singleton" topic doesn't make sense,
>> and doesn't reflect the spec. I responded on the gist.
>>
>> Dmitry
>>
>> On Sat, Mar 28, 2015 at 4:41 AM, Axel Rauschmayer <axel at rauschma.de>
>> wrote:
>>
>>> FWIW: I have written down my understanding of the ES6 iteration protocol
>>> (shaped by discussions I had on this mailing list).
>>>
>>> https://gist.github.com/rauschma/73e5f86a595b7709f39e
>>>
>>> --
>>> Dr. Axel Rauschmayer
>>> axel at rauschma.de
>>> rauschma.de
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss at mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150406/755bf90a/attachment.html>


More information about the es-discuss mailing list