:
http://www.2ality.com/2011/03/first-look-at-upcoming-javascript.html
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org
} = ... some expression ...;
also binds the identifier |drawShape|.
Got it. Makes sense.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https
. Object.create() feels like a good start. I’ve tried my
hand at a purely prototypal API, but I find it difficult to make the syntax as
beautiful as plain object literals.
http://www.2ality.com/2011/01/going-completely-prototypal-in.html
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
of classes in JavaScript.
[1]
http://wiki.ecmascript.org/doku.php?id=strawman:obj_initialiser_class_abstraction
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es
list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https
globals inside a module are module-relative. Then
everything would work out fine.
I don't understand this comment.
Dave
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss
I'm not sure how this would be done best or how useful it would be, but: has
dependency injection been considered as a use case for modules (e.g. to swap
modules during testing)?
One possibility might be to give modules parameters that module clients have to
provide.
Axel
--
Dr. Axel
other, e.g. global,
reference).
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
;
}
On Apr 10, 2011, at 10:24 AM, Axel Rauschmayer wrote:
As far as I am aware, there is no way to change a property that isn’t at the
beginning of the property chain, because the change will create a new
property there.
Are there plans to change this? It would be nice to have something
it there.
Thanks,
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
. Thus, a better solution
would be
while (!Object.prototype.hasOwnProperty.call(obj, key))
But I usually prefer David’s more readable version and take the risk of a name
clash.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
to use, people don't use them.
Yes, I’m all for simplicity.
Module loaders do give you the ability to do dependency injection, though, by
changing the semantics of module URL's.
Right. This should give one everything one needs.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
means? DI is an important issue and I'd like to
understand how it is intended to be achieved in the future module
system.
Module loaders do give you the ability to do dependency injection, though,
by changing the semantics of module URL's.
--
Dr. Axel Rauschmayer
a...@rauschma.de
in strict
mode and in non-strict mode, as explained in the comment.
Thanks!
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org
()
with more obvious semantics. I try to avoid expert magic when using a
programming language and it seems like a shame that this kind of magic is
necessary here ( {} and valueOf()).
Greetings,
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
are highly appreciated.
Greetings,
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Would it make sense to standardize more exception/error types, for example to
add a MissingParameterError in ES.next?
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es
motivated
by Java having several predefined exceptions with descriptive names that are
easy to reuse.
With JavaScript, is throwing a string considered bad style (now or in the
future)? That is, is throwing a new Error(msg) better than throwing msg
directly?
Axel
--
Dr. Axel Rauschmayer
must have
noticed the variety of opinions on this list alone!). Someone has to make the
hard decisions: Fred Brooks says that (the core of) good design can only be
done by a team of one (two if one of them is dominant).
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home
.
Isn’t (1) a better solution? I’m assuming (2) is done, because (1) would be too
radical a change (execution contexts etc.)? (1) could be simulated by always
binding |this| in non-method functions, but that isn’t done because of
performance issues(?)
Thanks!
Axel
--
Dr. Axel Rauschmayer
an explicit (this = ...)
parameter.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
): a function that
does not have an implicit |this| parameter.
Hm, you've lost me... [...]
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https
meant what you
call object reference. Similar to Common Lisp places (setf etc.), I suppose.
If you use the conditional operator, you can force the dereferencing of an
object reference:
(true ? obj.method : null)(arg)
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home
actually want to program in it. This is
difficult enough, given all the parties that have to be pleased. Listening to
feedback from compiler writers should be a secondary goal.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
. Still missing is convenient subtyping
The remaining missing functionality is subtyping, but that could be added as an
API (let me know if I should give an example, it would look a lot like YUI, but
with less impedance mismatch).
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home
= title;
}
Worker.prototype = Object.create(Person.prototype);
Worker.prototype.describe = function() {
return Person.prototype.describe.call(this)+ (+this.title+);
};
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
for functions)?
Thus: are blocks completely different from functions or are they translated to
the same construct (internally). I can imagine this being done to make
|arguments| lexical, but it seems tricky for handling lexical |this|.
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
for specifying enumerability.
I would prefer something like
var foo = {
{ !conf !enum !write } high_integrity: 42,
...
};
Yes, it is more verbose, but also more descriptive.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
like identifier names are accessible to quasi
handlers, which would make this difficult.
BTW: “Desugaring” at the beginning of “Semantics” seems mangled.
[1] http://api.jquery.com/template
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
about the proposal? Is there
anything he doesn’t like?
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es
;
}
equals(p) { return this.@x === p.@x this.@y === p.@y; }
...
}
Maybe something like the following would work, too:
private.x = x;
...
return this.private.x === p.private.x;
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
to be applied to any object so feel free
to take credit.
I do agree that this beats inventing a new protocol. Very clever.
On Jun 15, 2011, at 8:35 , Brendan Eich wrote:
On Jun 14, 2011, at 11:25 PM, Axel Rauschmayer wrote:
Cool! That’s what I meant when I wrote the following:
From: Axel
be inherited:
const SkinnedMeshExtended = SkinnedMesh | { ... }
Then the following class method could also be called:
SkinnedMeshExtended.cm()
Right?
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es
would be easy. I am assuming that order matters, if not, then there is
something fundamental about handler parameters that I haven’t understood.
Using jQuery templates to validate template support: good choice, I really like
this templating engine.
Axel
--
Dr. Axel Rauschmayer
two different types, one for literal parts, one
for substitutions.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo
Right, I feel stupid: Even though the literal does not really exist as a
reified construct (separate from code), the corresponding code can be executed
multiple times.
On Jun 15, 2011, at 18:04 , Mark S. Miller wrote:
On Wed, Jun 15, 2011 at 8:36 AM, Axel Rauschmayer a...@rauschma.de
front.
Added http://wiki.ecmascript.org/doku.php?id=harmony:quasis#callsiteid
and renamed rawLP and unescapedLP.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es
, Allen Wirfs-Brock al...@wirfs-brock.com
wrote:
On Jun 15, 2011, at 4:43 PM, Mark S. Miller wrote:
On Wed, Jun 15, 2011 at 4:42 PM, Axel Rauschmayer a...@rauschma.de wrote:
Ah, very clever. It’d be nice to have an example of using this to compile
templates (like jQuery templates). Maybe
]);
This is bike-shedding, but I’d also prefer uninterpreted and interpreted
instead of raw and cooked.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss
the desugaring is local.
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Syntax error (in some cases)?
On Jun 17, 2011, at 21:38 , Mark S. Miller wrote:
On Fri, Jun 17, 2011 at 12:18 PM, Mike Samuel mikesam...@gmail.com wrote:
2011/6/17 Axel Rauschmayer a...@rauschma.de:
and redefines the SVE of ${=x.y} to be
function () { return arguments.length
a [[Construct]] internal method that invokes the
constructor method, its really just an alternative way to specify the same
thing.)
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing
by Allen:
new SkinnedMesh(...) = new SkinnedMesh.constructor(...)
However: THREE.Mesh would have to refer to the prototype (similarly to how
things are done above), for this to work.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
that everything (modulo builtins) works fine if
the above assignment is made *somewhere*.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https
(especially
subclassing). With “prototypes as classes”, a proto operator (such as |) and
super, we would have a long-term simplification that to me almost feels like
a clarification of what is going on already.
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
have here === this.
Axel
On Jun 19, 2011, at 19:44 , Peter Michaux wrote:
On Sun, Jun 19, 2011 at 10:20 AM, Axel Rauschmayer a...@rauschma.de wrote:
It would be nice if super could work in any method and not just those
methods that are defined inside an object literal. Then, a method would have
, such things could still be
wired up manually (most likely by somebody wanting to create procedural
abstractions for class-like definitions.
Are you thinking along the lines of the following example?
var MyClass = class({ ... });
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
, then ES.next might even be at the center of a
triangle (Java, Smalltalk, Lisp) – which is a good thing.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
day, give us the
ability to *set* a property that is not at the beginning of a property chain.
For now, programmers would never directly see |here|, only |super|. |super|
would be computed on demand, only when someone asks for that value.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com
' is not bound
dynamically per call site, as 'this' is. It's a hidden property of the
function object.
/be
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss
be retasked as keywords, especially not
with the name of the function in a function expression optional.
Ah, damn, I knew it was a very convincing argument. ;-)
There is still the faint hope that this isn’t actually used in practice, but
still.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com
and methods
- lexical this -- new, more compact construct, mainly used as the argument of
functions and methods.
This distinction works well as a rule of thumb and keeps things easy to explain.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
to pass in |this|
plus property name plus value for properties and be used for all kinds of
things.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
have |this|
parameters, whether created by old function or new arrow syntax.
Right. That could be a problem, the abstraction I have in mind might become
leaky at some point.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
things) would
be a static value, not a dynamic one (unlike |this|). Or (a static) |super|
might just be used directly.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es
is not used there is little computational cost! (Other than a binding
per function call which may still be prohibitive.)
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es
(obj, propName):
http://www.mail-archive.com/es-discuss@mozilla.org/msg06652.html
But I can also imagine syntactic sugar:
obj.foo := abc
desugars to
Object.getDefiningObject(obj, foo).foo = abc
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog
naturally, that would be great. But
as that seems impossible, forcing things does not make sense.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https
:
- Property lookup = returns a place, e.g. a pair (object, property name)
- Use the place to either read the property value or to change it.
Can’t comment on Proxies, though.
On Jun 21, 2011, at 21:36 , Brendan Eich wrote:
On Jun 21, 2011, at 8:24 AM, Axel Rauschmayer wrote:
As a loose analog
=== String.prototype, but this === s. Otherwise
String.prototype.trim() could not access the properties of s (such as s.length).
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss
at the same time:
const red = new Color(FF);
const green = new Color(00FF00);
Color.prototype.getAllColors().forEach(...);
But you could also produce the colors with a factory.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
| {
foo: function me(x) {
me.super.foo.call(this, x);
}
}
Does the named function expression cost nothing here?
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es
wrote:
On Jun 21, 2011, at 9:50 PM, Axel Rauschmayer wrote:
That sounds like the opposite argument you are making with regard to the
hypothetical |here|:
BTW I do not agree we can or should try to reserve 'here' or expose the
method's home object -- that breaks abstractions built using
this, e.g.
Array.prototype.myClassMethod(), then this.myClassVariable would *still* work.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https
for getters, you have
your way to change a value directly on the prototype chain.
Of course, if you want to change the property descriptor on the prototype
chain, none of what I said apply.
David
Le 21/06/2011 17:24, Axel Rauschmayer a écrit :
As a loose analog to the prototype-chain
. If we
introduce multiple special forms that can introduce a this-rebinding
boundary, where the new ones are easily missed, we make this burden worse. Is
- easily missed? (I would guess so.) And if it is, what are we getting in
exchange, and is it worth it?
--
Dr. Axel Rauschmayer
provided a
counter-example.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
a this gist https://gist.github.com/1033258
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
() {
var constr = (this instanceof Function ? this : this.constructor);
var instance = Object.create(constr.prototype);
constr.apply(instance, arguments);
};
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
(that are muddled with constructor
functions – see subclassing):
- Instantiation: Creating a new instance
- Initialization: Setting up a new instance
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss
to check the following?
o instanceof C
You look for C.prototype in the prototype chain of o.
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss
these lines become standard in some later edition.
On Tue, Jun 28, 2011 at 4:34 PM, Axel Rauschmayer a...@rauschma.de wrote:
http://blog.mozilla.com/dherman/2011/06/28/the-js-parser-api-has-landed/
I’ve just read D. Herman’s post on Firefox’s parser API. Is there any chance
that this kind
, title) {
Person.call(this, name);
this.title = title;
}
Worker.prototype = Person.prototype | {
constructor: Worker,
describe: function() {
return Person.prototype.describe.call(this)+ (+this.title+);
}
};
--
Dr. Axel Rauschmayer
.
On the other hand, having PaCs and classes/constructors is more complex than
just having one. And we do not get the choice of just having PaCs.
True!
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
from the constructor as the dominant construct
(conceptually, – nothing changes under the hood).
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
with current semantics.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
constructor() only has to
play role (2), whereas constructor functions have to sometimes play both roles,
sometimes only role (2) (when called from a sub-constructor).
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
that method constructor() is
called.
Anyway, the die was cast long ago.
I agree that this might be one of those cases where the cost of breaking
compatibility is not worth the benefits (especially if we even can’t agree that
there are benefits ;-)
--
Dr. Axel Rauschmayer
a...@rauschma.de
literals. But the abstraction argument might apply to both cases: If
people see a class C, they just want to instantiate it via new C(x,y). As long
as instanceof works accordingly afterwards, I’m not sure much has changed
*superficially*.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
On the other hand people may find Point.new(x, y) as intuitive, as they will
think of ruby instead of java.
As an aside, you can see API code for the above functionality here:
- https://github.com/Gozala/selfish [Irakli, updated]
- http://dl.2ality.com/dl/2011/06/Proto.js [me]
--
Dr. Axel
= zero;
// Now make some objects.
var two = new Real(2);
var i = new Imaginary(2);
var oneone = new Complex(1, 1);
Isn't that prototype-focused enough?
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
is that it is a bad idea to have two class
mechanisms.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
)
this.age = age
}
Child.__proto__ = Parent
Child::__proto__ = Parent.prototype
Child::describe = function () {
return 'I am called ' + this.name + ' and I am ' + this.age + ' years old'
}
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
2011 21:10, Axel Rauschmayer a...@rauschma.de wrote:
I don't think
JavaScript has ever been far from its prototype roots especially if
the programmer shifts to thinking about a prototype object instead of
thinking about a functions prototype property.
That is basically the point
://mail.mozilla.org/options/es-discuss
Can this be fixed? I’ve already sent feedback, but didn’t get a response.
Preferably, passwords would also be encrypted for storage.
--
Dr. Axel Rauschmayer
axel at rauschma.de
twitter.com/rauschma
Home: rauschma.de
Blog: 2ality.com
--
Dr. Axel
(?) What else?
IDE support would be a pro-class literal argument, I guess. Another question:
If *everything* is encapsulated (instantiation, subclassing, instanceof, etc.)
then it doesn’t matter any more what goes on under the hood.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
++) {
(function() {
var iCopy = i;
a.push(function () { return iCopy; });
}());
}
}());
print(a[0]()); // 0
Axel
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
/flexibility (comflexibility?). Consider Smalltalk, CLOS, Python,
Ruby, or C#. You can have classes in a beautiful language.
- bob
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing
is used to increment a non-local
variable. That is, loops should be allowed to have side effects. I’m not sure
how this applies to iterators, as they are handled by reference.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
observed in providing
support for this protocol in a Common Lisp, including ensuring that there is no
performance impact from its inclusion.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es
been created for it) and not a
method that instantiates and initializes at the same time. initialize() works
together very well with super-references, because in subclasses, you simply
call the super-initialize method.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home
of parameterized object literals. But then I have no
idea where class properties would go:
class Point(x,y) {
x: x,
y: y,
prototype {
manhattanDistance() {
return Math.abs(this.x) + Math.abs(this.y);
}
}
}
--
Dr. Axel Rauschmayer
a...@rauschma.de
' -- users get to name the
module. With ES.next modules, one can even selectively import:
import createFunction from @proxy;
This is awesome! A lot of “static” methods will go away now that we finally can
have real modules.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home
properties are actually
added to the constructor). To me the class literal proposal looks like
prototypes-as-classes, with desugaring to constructor-functions-as-classes.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
do? Wouldn't
point simply return an object literal (no this )?
No, because the [[Construct]] internal method set this to a new object whose
[[Prototype]] is correctly initialized to Point.prototype. You could return:
Point.prototype | { ...
Got it. Nice.
--
Dr. Axel Rauschmayer
code and use the operator in Harmony-only
code.
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
increment to obj
increment increments obj
increment overrides obj
--
Dr. Axel Rauschmayer
a...@rauschma.de
twitter.com/rauschma
home: rauschma.de
blog: 2ality.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org
1 - 100 of 1092 matches
Mail list logo