Alternative syntax for <|
Brendan Eich
brendan at mozilla.com
Tue Nov 22 10:41:07 PST 2011
On Nov 22, 2011, at 9:48 AM, Claus Reinke wrote:
>>> Recently Claus Reinke proposed some alternative that I think feels is so much more natural and simpler than <| or beget:
>>> ..
>>> .. re-interpretation deleted ..
>
> Ahem;-) Glad to see my proposal noticed, but what I really
> suggested, in
>
> motivating <| as structure representation, not operator
> https://mail.mozilla.org/pipermail/es-discuss/2011-November/018626.html
Nothing there about arrays or regular expressions, and the function examples do *not* show anything like
superFun <| function (...) {...}
Instead of Ahem'ing, could you cite what you claim is a prior proposal with specifics showing how it addresses object, array, regexp and function [[Prototype]] presetting?
/be
>
> was to interpret
>
> proto <| {..}
>
> as a source representation of the unwritable
>
> { [[prototype]]: proto , .. }
>
>> Two problems:
>>
>> 1. Does not work for array, function, and regexp literal right-hand sides.
>
> With my original suggestion, could work for array, and regexpr,
> and function. The difference from the original <| was just that I
> wanted to interpret <| directly as structure representation, not
> as an operator taking a full object rhs.
>
> Though I suggested to eliminate the special case for function,
> and to set only [[prototype]], not 'prototype' as well.
>
> We should be explicit about setting function's [[prototype]] or
> setting function's 'prototype' (the [[prototype]] for new objects).
>
>> 2. Preempts a property name. We cannot preempt 'prototype',
>> and '__proto__' was already tried (it sucks due to preemption
>> combined with magic meta-programming power in what looks
>> like just another property).
>
> Not an issue with my original suggestion, as the name is implicit.
>
> Claus
> http://clausreinke.github.com/
>
More information about the es-discuss
mailing list