In case it helps, the idea mooted for ES7 is that you'd add a call
handler to the class for when it is invoked without `new`:
class Point2D {
constructor(x, y) { this.x = x, this.y = y; }
[Symbol.call](x, y) { return new this.constructor(x, y); }
...
}
I used
5. Re: How to fix the `class` keyword (Allen Wirfs-Brock)
One of those possible enhancement that has been talked about is to
implicitly treat a [[Call]] of a class constructor as an implicit 'new',
just like you are suggesting.
Doesn't this need to be configurable, and Brendan Eich
I've already posted this on my Medium blog here:
https://medium.com/@_ericelliott/how-to-fix-the-es6-class-keyword-2d42bb3f4caf
It seems inevitable that the `*class*` keyword in JavaScript is going to
catch on, but that’s a problem because it’s fundamentally broken in many
ways.
Now that it’s
What ever happened to Array.prototype.contains? There's an old strawman for
Array.prototype.has (
http://wiki.ecmascript.org/doku.php?id=strawman:array.prototype.has ) that
references this thread: (
https://mail.mozilla.org/pipermail/es-discuss/2012-February/020745.html )
But it seems the thread
at 2:07 AM, David Bruant bruan...@gmail.com wrote:
Le 05/03/2014 09:24, Eric Elliott a écrit :
What ever happened to Array.prototype.contains? There's an old strawman
for Array.prototype.has (
http://wiki.ecmascript.org/doku.php?id=strawman:array.prototype.has )
that references this thread
when you're switching on something with a meaningful
conversion to string.
On 20 Feb 2014, at 21:20, Eric Elliott e...@ericleads.com wrote:
Object literals are already a great alternative to switch in JS:
var cases = {
val1: function () {},
val2: function () {}
};
cases[val
Object literals are already a great alternative to switch in JS:
var cases = {
val1: function () {},
val2: function () {}
};
cases[val]();
Fall through is more trouble than it's worth, IMO.
On Feb 17, 2014 1:44 PM, Giacomo Cau cau.giacomo...@tiscali.it wrote:
-Messaggio
Brendan,
You seem to only be replying to the most recent comment in this thread, and
not considering the objections that I raised at the beginning of the
thread. My argument is that class isn't just a little bit of sugar. I
believe that counter to its goal, it will reduce programmer productivity
JS is a rich language that allows different styles of programming. Nothing
wrong with that.
What's wrong is that when we give people `class` and `extends`, books and
blog posts everywhere will begin to teach that this is how we do
inheritance in JavaScript, ignoring all the perils that go with
about it.
- Eric
On Sat, Jun 29, 2013 at 7:07 PM, Axel Rauschmayer a...@rauschma.de wrote:
On Jun 29, 2013, at 20:12 , Eric Elliott e...@ericleads.com wrote:
If I were advertising, there are better places to do it, and better ways.
I feel like adding class to JS would be detrimental
Honest question: how can this problem not be solved via ES6 classes plus
mixins? The original hierarchy already feels wrong. Why not create a
super-class Animal, with sub-classes Human, Ape, Bird, Bee, Fish, Whale
plus the mixins Walking, Flying, Swimming?
I completely agree with you, but in the
inherited pieces. That skeleton doesn’t even have to be a
hierarchy, it could be a set of classes.
Maybe you simply need to write a mixin or trait library that works well
with ES6 classes?
Axel
On Jul 1, 2013, at 0:22 , Eric Elliott e...@ericleads.com wrote:
Honest question: how can this problem
/69255635
3) Are there specific points that you disagree with?
- Eric
On Sat, Jun 29, 2013 at 7:11 AM, Alex Russell slightly...@gmail.com wrote:
On 28 Jun 2013 19:31, Eric Elliott e...@ericleads.com wrote:
I'm not here to discuss the mechanics of what class does. I'm just
saying we
even if you start out using class
inheritance, it can be problematic to switch to mixins and similar
strategies down the road.
- Eric
On Fri, Jun 28, 2013 at 7:41 PM, Claude Pache claude.pa...@gmail.comwrote:
Le 29 juin 2013 à 00:14, Eric Elliott e...@ericleads.com a écrit :
snip
I saw
it.
On Jun 29, 2013, at 8:58, Eric Elliott e...@ericleads.com wrote:
Hi Alex,
Your response is extremely vague. It doesn't seem to say more than I
think you're wrong. Oh, and lots of other people think you're wrong too.
1) Who are these many who disagree with the potential for harm? Can you
I know this has been batted around already. I know everybody's totally
stoked about class sugar in ES6. I just wanted to register my protest. I
made my arguments in this talk at Fluent:
http://ericleads.com/2013/06/classical-inheritance-is-obsolete-how-to-think-in-prototypal-oo/
I'm already
a video, I guess the conversation is over. =)
- Eric
On Fri, Jun 28, 2013 at 10:45 AM, Tab Atkins Jr. jackalm...@gmail.comwrote:
On Fri, Jun 28, 2013 at 10:42 AM, Eric Elliott e...@ericleads.com wrote:
I know this has been batted around already. I know everybody's totally
stoked about class
-
http://davidwalsh.name/javascript-objects (3 parts)
- Eric Elliott
On Fri, Jun 28, 2013 at 11:40 AM, Tab Atkins Jr. jackalm...@gmail.com
wrote:
On Fri, Jun 28, 2013 at 11:31 AM, Eric Elliott e...@ericleads.com wrote:
I'm not here to discuss the mechanics of what class does. I'm just
saying we
in
JavaScript.
The problem isn't with the ES6 implementation. It's the whole paradigm.
- Eric
On Fri, Jun 28, 2013 at 2:27 PM, David Bruant bruan...@gmail.com wrote:
Hi Eric,
Le 28/06/2013 19:42, Eric Elliott a écrit :
I know this has been batted around already.
Has it? :-p
I know
.
JavaScript is confusing enough to people without adding `class`. Sometimes
giving people more choice is a bad thing:
http://www.amazon.com/The-Paradox-Choice-More-Less/dp/0060005696
- Eric
On Fri, Jun 28, 2013 at 3:55 PM, David Bruant bruan...@gmail.com wrote:
Le 29/06/2013 00:14, Eric Elliott a écrit
for preaching to the choir and/or ruffling feathers
DFKaye
--
*From:* David Bruant bruan...@gmail.com
*To:* Eric Elliott e...@ericleads.com
*Cc:* es-discuss es-discuss@mozilla.org
*Sent:* Friday, June 28, 2013 3:55 PM
*Subject:* Re:
Le 29/06/2013 00:14, Eric
21 matches
Mail list logo