Re: Overly complicated Array.from?

2013-12-29 Thread David Bruant
Le 29/12/2013 14:42, Brendan Eich a écrit : David Bruant wrote: Le 29/12/2013 01:48, Brendan Eich a écrit : David Bruant wrote: it's somewhat ironic that Array carries 'from' given it's the only class that doesn't need it per case study for 3) above :-) But Array is the return type. It's

Re: Overly complicated Array.from?

2013-12-28 Thread David Bruant
Le 27/12/2013 19:10, Claude Pache a écrit : There is still the issue of potential libraries that produce arraylikes that don't inherit from a built-in arraylike prototype: those won't benefit from your polyfill without changing their inheritance strategy. I don't understand the expression

Re: Overly complicated Array.from?

2013-12-28 Thread David Bruant
Le 28/12/2013 15:25, Brendan Eich a écrit : This seems overcomplicated. Isn't the likelier code something like Array.from || (Array.from = function(b) { var a=[]; for (var i=0; ib.length; i++) a.push(b[i]); return a; }); Isn't the whole point to impute arraylikeness to the parameter? In

Re: Overly complicated Array.from?

2013-12-28 Thread Rick Waldron
On Sat, Dec 28, 2013 at 11:37 AM, David Bruant bruan...@gmail.com wrote: Le 28/12/2013 15:25, Brendan Eich a écrit : This seems overcomplicated. Isn't the likelier code something like Array.from || (Array.from = function(b) { var a=[]; for (var i=0; ib.length; i++) a.push(b[i]); return

Re: Overly complicated Array.from?

2013-12-28 Thread Rick Waldron
'); Subject: Re: Overly complicated Array.from? On Sat, Dec 28, 2013 at 11:37 AM, David Bruant bruan...@gmail.com wrote: Le 28/12/2013 15:25, Brendan Eich a écrit : This seems overcomplicated. Isn't the likelier code something like Array.from || (Array.from = function(b) { var

RE: Overly complicated Array.from?

2013-12-28 Thread Domenic Denicola
it. At least, that's what it seems to me. From: David Bruantmailto:bruan...@gmail.com Sent: ‎12/‎28/‎2013 17:28 To: Rick Waldronmailto:waldron.r...@gmail.com Cc: Brendan Eichmailto:bren...@mozilla.com; EcmaScriptmailto:es-discuss@mozilla.org Subject: Re: Overly

Re: Overly complicated Array.from?

2013-12-28 Thread Rick Waldron
On Sat, Dec 28, 2013 at 5:44 PM, Domenic Denicola dome...@domenicdenicola.com wrote: I believe that Array.from's only purpose is to provide guidance for polyfills for people to use in ES3/ES5 code; nobody writing ES6 would ever use it. Ignoring any of the previous benefits I've discussed,

RE: Overly complicated Array.from?

2013-12-28 Thread Domenic Denicola
/‎2013 18:12 To: Domenic Denicolamailto:dome...@domenicdenicola.com Cc: David Bruantmailto:bruan...@gmail.com; Brendan Eichmailto:bren...@mozilla.com; EcmaScriptmailto:es-discuss@mozilla.org Subject: Re: Overly complicated Array.from? On Sat, Dec 28, 2013 at 5:44 PM, Domenic Denicola dome

Re: Overly complicated Array.from?

2013-12-28 Thread David Bruant
Le 29/12/2013 00:11, Rick Waldron a écrit : On Sat, Dec 28, 2013 at 5:44 PM, Domenic Denicola dome...@domenicdenicola.com mailto:dome...@domenicdenicola.com wrote: I believe that Array.from's only purpose is to provide guidance for polyfills for people to use in ES3/ES5 code; nobody

Re: Overly complicated Array.from?

2013-12-28 Thread Brendan Eich
David Bruant wrote: it's somewhat ironic that Array carries 'from' given it's the only class that doesn't need it per case study for 3) above :-) But Array is the return type. /be ___ es-discuss mailing list es-discuss@mozilla.org

Re: Overly complicated Array.from?

2013-12-28 Thread David Bruant
Le 29/12/2013 01:48, Brendan Eich a écrit : David Bruant wrote: it's somewhat ironic that Array carries 'from' given it's the only class that doesn't need it per case study for 3) above :-) But Array is the return type. It's always the return type of Array.from(x), but not the return type of

Re: Overly complicated Array.from?

2013-12-27 Thread Claude Pache
Le 26 déc. 2013 à 18:20, David Bruant bruan...@gmail.com a écrit : Le 26/12/2013 10:58, David Bruant a écrit : Le 26/12/2013 05:00, Rick Waldron a écrit : On Wed, Dec 25, 2013 at 7:33 PM, David Bruant For the rationale, the wiki states [1]: There are many array-like objects in JS

Re: Overly complicated Array.from?

2013-12-26 Thread David Bruant
Le 26/12/2013 05:00, Rick Waldron a écrit : On Wed, Dec 25, 2013 at 7:33 PM, David Bruant For the rationale, the wiki states [1]: There are many array-like objects in JS (arguments objects, DOM NodeLists, arrays from separate windows, typed arrays) and no simple way to convert

Re: Overly complicated Array.from?

2013-12-26 Thread David Bruant
Le 26/12/2013 10:58, David Bruant a écrit : Le 26/12/2013 05:00, Rick Waldron a écrit : On Wed, Dec 25, 2013 at 7:33 PM, David Bruant For the rationale, the wiki states [1]: There are many array-like objects in JS (arguments objects, DOM NodeLists, arrays from separate windows,

Re: Overly complicated Array.from?

2013-12-25 Thread Rick Waldron
On Wed, Dec 25, 2013 at 7:33 PM, David Bruant bruan...@gmail.com wrote: Hi, I was reading the current spec for Array.from and it felt too complicated to me. I've been following the specification of Array.from very closely since the day Dave and I first designed it and it's exactly as