var Blah = BaseClass <| function(){}
Blah.prototype.{
a: function(){},
b: function(){}
}
let Blah = BaseClass <| function() {
}.prototype.(
a() {},
b() {}
}.constructor.{};
1. I don't like the imperative approximations of a declarative API.
Since we're designing new language features, approximations
should not be necessary.
There have been suggestions to interpret '<|' declaratively,
and to avoid the special case for function rhs, ie, to interpret
(p <| obj) simply as a structural representation of an object
with un-nameable '[[prototype]]' field containing p.
What were the arguments against this?
2. JS claims to be prototype-based but the 'prototype'-field really
points to shared traits, while the actual cloning of prototypes
into objects happens in the constructor functions. A deviation
from Self (if I recall that correctly), it is a source of confusion.
If we combine the two points (cloning happens in the constructor,
<| declares 'prototype' field), we get something like:
var Blah = function(){
return BaseClass <| {
a: function(){},
b: function(){}
}
}
Claus
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss