Besides. The same inheriting keyword can be used for both -- classes
inheriting and just classless (or chaotic, prototypal) reuse:
foo < bar
class Foo < Bar
or
foo extends bar {
y: 20
}
class Foo extends Bar
Since both implements the same pattern -- linear vertical "tower" of
code reuse (in simple words -- just single inheritance), then the same
keyword seems also logical.
Dmitry.
On 18.05.2011 11:41, Dmitry A. Soshnikov wrote:
On 18.05.2011 6:50, Allen Wirfs-Brock wrote:
We had so much fun with feedback on my Unicode proposal I just have
open another one up for list feed back:
An updated version of the "prototype for" (formerly proto) operator
proposal is at
http://wiki.ecmascript.org/doku.php?id=strawman:proto_operator
Just a small note on:
"There are many other possible special character alternates to *|<||*.
For example, *||>|*, *|^^|*, *|*>|*, *|&>|*, *|^||*, *|<|-|*, etc. It
isn't clear that any of these is more meaningful or mnemonic than *|<||*."
Perhaps just "less than" would be enough? Why we need two symbols?
It's by the way, a real implementation of subclassing in Ruby:
class Foo
def alert
p "Called from Foo class"
end
end
class Bar < Foo
def alert
super
end
end
bar = Bar.new
bar.alert # "Called from Foo class"
It sounds quite logical -- "by hierarchy Bar is *less than* Foo".
And also: what's happened to meta-properties in initialisers? It seems
to me that having them we get also the ability not only to specify the
proto, but also other control attributes for properties and to the
object. And since #-symbol has changed its semantics, and instead
->-functions (or probably Ruby's blocks) are on agenda instead, maybe
we may use # exactly for meta properties?
let foo = {x: 10};
let bar = {
#proto: foo,
#closed
y: 20,
// etc.
};
Dmitry.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss