prototype for operator proposal for review

Allen Wirfs-Brock allen at
Wed May 18 09:10:38 PDT 2011

On May 18, 2011, at 12:41 AM, 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 
> 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:

< already has a meaning for operands that are arbitrary objects.  It applies valueOf and/or toString to the operands and then compares the results.

> 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?

The most common use case for meta properties was to set [[Prototype]].  That solution worked for object literals and array literal but didn't extend to functions, regexps, or other literal forms.  <| does.  The other uses of meta properties sealed, frozen, closed would probably be used infrequently enough that the Object functions are good enough:

      let bar = Object.preventExtensions(foo <| {y:20});

Also there were some concerns about possible syntactic conflicts between the proposed meta-property syntax and E4X features (I know...but some people care)...

Overall, <| seems like a simpler solution that is more general for the most important use case.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list