An "extend" operator is a natural companion to <|

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Jul 19 11:39:49 PDT 2011


Ok,  I did a side-by-side comparisons of some alternatives.  Seehttp://wiki.ecmascript.org/lib/exe/fetch.php?id=harmony%3Aspecification_drafts&cache=cache&media=harmony:protooperator_alternatives.pdf 

The first column is by prototypal inheritance example using<| and <& from the first message in this thread.

The second column is the same example with <| and <& replaced by keyword operators "prototypes" and "extendBy".

The third column uses Object.specialize and Object.extend calls instead of <| and <&.

Note that Object.create can't be used instead of Object.specialize because I want the second argument to be a regular object literal rather than a property descriptor.

By their nature these are short examples and impressions may not scale to larger samples. 

If anybody wants to do their own experiments, the MS Word copy of the file is http://wiki.ecmascript.org/lib/exe/fetch.php?id=harmony%3Aspecification_drafts&cache=cache&media=harmony:protooperator_alternatives.doc 

Allen


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110719/582c51af/attachment.html>


More information about the es-discuss mailing list