Re: Why can’t for-of be applied to iterators?

Andreas Rossberg rossberg at google.com
Tue Jun 11 06:21:53 PDT 2013


On 11 June 2013 15:16, Domenic Denicola <domenic at domenicdenicola.com> wrote:
> I guess this is kind of the opposite direction Andy and Andreas have been going, but it does seem conceptually clearer to me to separate the concept of "something that can be iterated" (iterable) from "an instance of that iteration" (iterator). The former doesn't have state, usually, whereas the latter does. Hrm.

FWIW, I had argued for a cleaner separation along the lines you
suggest a while ago (see
https://mail.mozilla.org/pipermail/es-discuss/2013-March/029004.html).
However, I think not needing the notion of iterable at all would be
even better.

/Andreas


More information about the es-discuss mailing list