W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2014

RE: map() annotation for iterables?

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Sun, 5 Oct 2014 00:49:49 +0000
To: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <882affd3d1424a3b8249efd09d099603@BN1PR05MB325.namprd05.prod.outlook.com>
From: Boris Zbarsky [mailto:bzbarsky@mit.edu] 

> More precisely, is there any interest in recasting Array.prototype.map to be able to work on a generic iterable and then put it on the proto chain of DOM iterables?

I believe not; the algorithms for Array.prototype.* are pretty set in stone.

However, recently all iterators gained a currently-empty common prototype [%IteratorPrototype%][1]. This was done so that, in the future, we could define %IteratorPrototype%.{map, filter, etc.}. I think this will be the more fruitful way forward.

[1]: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-%iteratorprototype%-object

Received on Sunday, 5 October 2014 00:50:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:23 UTC