with

Dmitry Soshnikov dmitry.soshnikov at gmail.com
Thu Nov 17 05:16:16 PST 2011


On 17.11.2011 17:08, David Herman wrote:
> On Nov 17, 2011, at 3:53 AM, Dmitry Soshnikov wrote:
>
>> Once again, it's absolutely the same approach which I showed 
>> yesterday with using `extends' 
>> (https://mail.mozilla.org/pipermail/es-discuss/2011-November/018478.html).
>
> My point has absolutely nothing to do with semantics and everything to 
> do with syntax.

Well, at least in semantics we're agree; it's already good.

> And `extends` fails completely as the syntax.

This is why it's so wide-spread in other languages for inheritance, 
right? ;)

`extends' is here for years in many langs for exactly to chain an object 
with its prototype or class (the langs which first come in mind are: 
Java, PHP, Scala, CoffeeScript, Dart, others). It's not used to copy own 
properties!

*As well*, as it's not used to copy own properties in Ruby (in case if 
you want to argue with that Object.extend copies own properties in JS 
libs)! -- exactly from there was borrowed Object.extend to Prototype.js. 
In Ruby it just /chains/ an object with yet another "prototype" (hidden 
meta-class which inherits from mixin module).

So `extends' is for inheritance. And was even reserved in ES.

> It's backwards -- the prototype doesn't extend the own-properties!
>

Hope I made it more clear.

Once again (sorry, Axel Rauschmayer, you may skip this phrase ;)), I'm 
not against `with', I'm just worry about that it had/has diff. 
semantics. But. We may re-use it for mixins.

Dmitry.

Dmitry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111117/a0ce580b/attachment.html>


More information about the es-discuss mailing list