Alternative syntax for <|

Bob Nystrom rnystrom at
Tue Nov 22 10:54:31 PST 2011

On Tue, Nov 22, 2011 at 10:41 AM, Brendan Eich <brendan at> wrote:

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

I'm guessing this been proposed before but I think you could handle all of
those except RegExp with syntax something like:

// object:
{ extends someObj, prop1: value, prop2: value }

// array:
[ extends someObj, value1, value2 ]

// function declaration:
function foo(arg) extends someObj { ... }

// function expression:
function(arg) extends someObj { ... }

You could *maybe* cram it into RegExp with something like:

/pattern/ extends someObj;

I haven't been following the <| discussion closely (it seems like it's in
good hands and has lots of smart people poking at it) so forgive me if this
was proposed and rejected for valid reasons while I wasn't looking. :)

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

More information about the es-discuss mailing list