On 11/28/2018 10:17 AM, Andrew Kaiser wrote:
Hi all,

I have created a short proposal to introduce syntactic sugar for anonymous 
functions in a 'scala-like' manner, linked here 
https://github.com/andykais/proposal-placeholder-syntax.

I am hoping to hear feedback on whether or not this is interesting to people, 
as well as feedback on the proposal itself (e.g. is there a better operator to 
use than ` * `)

This is error-prone:

  const sum = numbers.reduce(? + ?)
transforms into
  const sum = numbers.reduce((x, y) => x + y)

but then:

  const identity = numbers.reduce(?)
transforms into
  const identity = (x) => numbers.reduce(x)
instead of the analogous
  const identity = numbers.reduce((x) => x)

And what would
  const z = numbers.reduce(? + ? > 0)
or
  const z = numbers.reduce(2*(? + ?))
or
  const z = numbers.reduce(foo(? + ?))
transform into?

    Waldemar
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to