Set iterators

Rick Waldron waldron.rick at
Mon Feb 13 08:06:27 PST 2012

On Mon, Feb 13, 2012 at 10:55 AM, Domenic Denicola <
domenic at> wrote:

> > As a starting point, would it make sense to provide an API that matches
> Array.prototype methods (where applicable)?
> I think this ties in to my earlier desire to make Array.prototype methods
> work with iterators in general [1]. That is, I think the correct way to do
> this would be:
> 1) To specify that "set is an iterator that, when iterated over, returns
> its values."
> 2) To specify that all iterators get (at least): every, filter, forEach,
> map, reduce, reduceRight, some

+1 This is very intuitive and the sort of thing that real-world developers
will be expecting

> One potential sticking point is that we might want filter and map to
> return sets themselves.

Not sure if this is a "sticking point" or just a good idea. I'm leaning
towards the latter :)

> [1]:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list