From: Tab Atkins Jr.mailto:jackalm...@gmail.com
Sent: 6/24/2013 1:28 PM
To: Domenic Denicolamailto:dome...@domenicdenicola.com
Cc: es-discussmailto:es-discuss@mozilla.org
Subject: Re: Why does Array.from also take a mapFn?
On Mon, Jun 24, 2013 at 12:55 PM, Domenic Denicola
dome
On Mon, Jun 24, 2013 at 12:01 PM, Rick Waldron waldron.r...@gmail.com wrote:
Another question that I don't think got an answer, or if it did I was
unable to understand it. Why is map singled out for `Array.from` instead
of, say, filter? It seems arbitrary.
It's not at all arbitrary: filter
On Tue, Jun 25, 2013 at 11:46 PM, Jason Orendorff
jason.orendo...@gmail.com wrote:
If (as I am beginning to suspect) it just makes no sense for NodeList
to be a subclass of Array, we should urgently figure out some kind of
recommendation for such cases. DOM has more than just the one.
We could
On Tue, Jun 25, 2013 at 9:46 AM, Jason Orendorff
jason.orendo...@gmail.com wrote:
Oh, I didn't get that Array.prototype.filter and the rest are going to
be subclass-friendly! Hmm. I want to love this change, but I'm
ambivalent. Typed arrays are fixed-length, and DOM NodeLists aren't
even
On Jun 25, 2013, at 7:46 AM, Jason Orendorff wrote:
On Mon, Jun 24, 2013 at 12:01 PM, Rick Waldron waldron.r...@gmail.com wrote:
Another question that I don't think got an answer, or if it did I was
unable to understand it. Why is map singled out for `Array.from` instead
of, say, filter? It
, June 24, 2013 3:50 PM
To: Domenic Denicola
Cc: es-discuss
Subject: Re: Why does Array.from also take a mapFn?
First, you normally want map and other iterative array functions to return the
same type of collect it was applied to:
var smalls = Int8Array.of(34, 78, -150, 127, -3, 12);
var
-discuss
Subject: Re: Why does Array.from also take a mapFn?
First, you normally want map and other iterative array functions to return
the same type of collect it was applied to:
var smalls = Int8Array.of(34, 78, -150, 127, -3, 12);
var negatedSmalls = smalls.map(v= -v); //negatedSmalltalk
On Jun 24, 2013, at 8:42 AM, Jason Orendorff wrote:
According to the January 30 meeting notes, Array.from is getting
optional map functionality.[1]
This is motivated by the following example:
class V extends Array {
constructor(...args) {
super(...args);
}
For reference, this is the thread:
https://mail.mozilla.org/pipermail/es-discuss/2013-February/028661.html
On 6/24/2013 9:31 AM, Allen Wirfs-Brock wrote:
On Jun 24, 2013, at 8:42 AM, Jason Orendorff wrote:
According to the January 30 meeting notes, Array.from is getting
optional map
From: Allen Wirfs-Brock [al...@wirfs-brock.com]
My recollection is that we first discussed that the existence of Array.from
make this issue somewhat less important because, just as you point out, .from
can be used in conjunction with anything that produces an Iterable such as
On 6/24/2013 9:42 AM, Domenic Denicola wrote:
That led to further discision of that usage and we got into things like the
last example:
```js
// Turn an array of nodeNames into NodeList of nodes
NodeList.from( [div], node = document.createElement(node) );
```
I think I must be missing
On 6/24/2013 9:44 AM, Brandon Benvie wrote:
On 6/24/2013 9:42 AM, Domenic Denicola wrote:
That led to further discision of that usage and we got into things
like the last example:
```js
// Turn an array of nodeNames into NodeList of nodes
NodeList.from( [div], node =
On Jun 24, 2013, at 9:42 AM, Domenic Denicola wrote:
From: Allen Wirfs-Brock [al...@wirfs-brock.com]
My recollection is that we first discussed that the existence of Array.from
make this issue somewhat less important because, just as you point out,
.from can be used in conjunction with
From: Rick Waldron [waldron.r...@gmail.com]
One reason is the extra allocation...
It's not at all arbitrary: filter isn't an operation used to change the value
of the items in the returned iterable.
OK, I think I see. This is because `NodeList.prototype.map` behaves differently
from
On Jun 24, 2013, at 10:22 AM, Domenic Denicola wrote:
From: Rick Waldron [waldron.r...@gmail.com]
One reason is the extra allocation...
It's not at all arbitrary: filter isn't an operation used to change the
value of the items in the returned iterable.
OK, I think I see. This is
Thanks Allen. The
```js
var squaredSmalls_try2= Int16Array.from(smalls.map(v= v*v)); // still no
good, because intermediate array is Int8Array
```
example certainly clears it up for me. Tricky stuff.
I was going to write it's still a bit weird to me that we overload
`Array.from` with
On Mon, Jun 24, 2013 at 12:55 PM, Domenic Denicola
dome...@domenicdenicola.com wrote:
Thanks Allen. The
```js
var squaredSmalls_try2= Int16Array.from(smalls.map(v= v*v)); // still no
good, because intermediate array is Int8Array
```
example certainly clears it up for me. Tricky stuff.
On Mon, Jun 24, 2013 at 9:31 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote:
On Jun 24, 2013, at 8:42 AM, Jason Orendorff wrote:
According to the January 30 meeting notes, Array.from is getting
optional map functionality.[1]
This is motivated by the following example:
class V
On Jun 24, 2013, at 5:21 PM, Dmitry Soshnikov wrote:
On Mon, Jun 24, 2013 at 9:31 AM, Allen Wirfs-Brock al...@wirfs-brock.com
wrote:
On Jun 24, 2013, at 8:42 AM, Jason Orendorff wrote:
According to the January 30 meeting notes, Array.from is getting
optional map functionality.[1]
On Mon, Jun 24, 2013 at 5:45 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote:
On Jun 24, 2013, at 5:21 PM, Dmitry Soshnikov wrote:
On Mon, Jun 24, 2013 at 9:31 AM, Allen Wirfs-Brock
al...@wirfs-brock.comwrote:
On Jun 24, 2013, at 8:42 AM, Jason Orendorff wrote:
According to the
20 matches
Mail list logo