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: Should the default constructor return the return value of super?

2013-12-28 Thread John Barton
On Fri, Dec 27, 2013 at 10:22 AM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Dec 27, 2013, at 7:27 AM, Brendan Eich wrote: ... I thought Allen designed things so class C {} differed from class C extends Object {} so as in the first case to avoid (a) super calling Object and

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: Should the default constructor return the return value of super?

2013-12-28 Thread Allen Wirfs-Brock
On Dec 28, 2013, at 5:35 AM, Sebastian Markbåge wrote: I completely agree that is the intended use and what we should be encouraging people to do. What I'm asking for is to intentionally break best-practices for a specialized use case. The use case I had in mind was React components.

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: Should the default constructor return the return value of super?

2013-12-28 Thread Brendan Eich
Allen Wirfs-Brock wrote: I generally try to avoid early errors that have a lot of conditions associated with them. That's a warning sign in JS specs, indeed. Adding class syntax as (mostly) sugar for the prototypal pattern does not obviously mean rejecting all unusual or exceptional variants

Re: Overly complicated Array.from?

2013-12-28 Thread Rick Waldron
On Saturday, December 28, 2013, Domenic Denicola wrote: Why can't jQuery do ```js if (typeof Symbol !== undefined Symbol.iterator) { jQuery.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; } ``` For the same reason I've stated here any time anyone ever brings up

RE: Overly complicated Array.from?

2013-12-28 Thread Domenic Denicola
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. In essence it's saying TC39 likes es6-shim more than Underscore, and is helping tell them what should be in it, with the hope that people use

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
Yes, I am; many apologies. I also forgot about how it would be useful for subclasses, e.g. Elements.from(nodeList), since subclasses don't have their own dedicated spread syntax. Withdrawn in full. From: Rick Waldronmailto:waldron.r...@gmail.com Sent:

Should the default constructor return the return value of super?

2013-12-28 Thread Rick Waldron
On Sat, Dec 28, 2013 at 8:35 AM, Sebastian Markbåge sebast...@calyptus.eujavascript:_e({}, 'cvml', 'sebast...@calyptus.eu'); wrote: I completely agree that is the intended use and what we should be encouraging people to do. What I'm asking for is to intentionally break best-practices for a

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: Should the default constructor return the return value of super?

2013-12-28 Thread Sebastian Markbåge
I'm not exactly sure where who you see ES6 classes fitting into React. We've explored using: class MyComponent extends React.Component { }; let MyComponent = React.createClass(class { }); let MyComponent = React.createClass({ method() { super(); } }); Your @@create example convinced me that