Pick operator

Benjamin Gruenbaum benjamingr at gmail.com
Sat Jun 20 07:22:44 UTC 2015


Some comments:

> { p1 as x, p2 } # o   // { x: o.p1, p2: o.p2 }

Not sure why the `as` syntax since we already have `x : p1 `  syntax from
destructuring.

> p # if o

This is really complicated syntax, especially given `if` is not an
expression.

> { a, b } @ [ 1, 2 ] // { a: 1, b: 2 }

A second operator seems even more overkill

> propname* # o

Yet more syntax.

> { a, b } ##

And another operator.


All and all I'm strongly against adding so much syntax complexity to
something like this, if the bind (`::`) proposal gets in you can do this
sort of thing with a simple function and get as-nice syntax.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150620/653210c0/attachment.html>


More information about the es-discuss mailing list