I'm with Luke here. We shouldn't abuse a common idiom from other languages, including upstream ones such as CoffeeScript.

Kris's suggestion of +> changed to deal with the "wrong direction" criticism (which I find compelling since the [[Prototype]] property is a reference):

  let sub = sup +< {p:1, q:2};

(E4X ambiguity, no worries.)

Comments?

/be

Luke Hoban wrote:
What do you think? Do you like ->  better than<| ?  Is it ok to not have it 
available for some possible future function shorthand?
Both =>  and ->  have strong associations with function shorthands from C#, Scala, C++,  
Java 8, Perl, CoffeeScript, ML, Haskell and more.  Whether or not JavaScript adopts a ->/=> 
 shorthand in the future (I still think it should), many developers will think of it as having an 
association with functions.  Using ->  for the proto-of operator effectively also removes the 
ability to use =>  as function shorthand later, due to the syntactic similarity of these two 
operators.

Any of these usages (at least for the more widely used languages) are fairly 
new so I don't know that they establish that strong of a precedent for ES.

They are new now, but 5 years from now when ES6 has breadth adoption these other 
languages will also be 5 years more established.  Many programmers will work in at 
least one of these other languages as well as in JavaScript.  There is also a 
relatively strong association of C-style languages using ->/=>  as function 
shorthand, and JavaScript is still (for better or worse) primarily seen as a C-style 
language.

Luke

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to