Andrew Kaiser (2018-12-12T16:22:40.000Z)
kaisea.rpi at gmail.com (2018-12-12T16:39:29.122Z)
thank you all for the feedback, I appreciate those who pointed out the flaws in the logic. I can see that this is an ambiguous proposal. Though I did not realize it at the time, this proposal is competing with https://github.com/tc39/proposal-partial-application, as the two syntax's cannot exist in the same language. I still find the scala-like pattern useful, and not all hope is lost. There is a babel macro https://www.npmjs.com/package/param.macro which was inspired by scala's `_`. Side note, they solve the issue of `g(f(?))` creating either `x => g(f(x))` or `g(x => f(x))` by splitting the logic into two different macros: `it` and `_`. ```javascript import { _, it } from 'param.macro' const arrayOfObj = [{ n: 1 }, { n: 2 }, { n: 3}] arrayOfObj.map(it.n) // yeilds // arrayOfObj.map(x => x.n) arrayOfObj.map(_.n) // yeilds // x => arrayOfObj.map(x.n) ``` If anyone is interested in keeping the proposal alive/modifying it, feel free to put a pull request on my repo https://github.com/andykais/proposal-placeholder-syntax. Otherwise, I don't believe I see a lot of interest in it according to this discussion.
kaisea.rpi at gmail.com (2018-12-12T16:38:33.242Z)
thank you all for the feedback, I appreciate those who pointed out the flaws in the logic. I can see that this is an ambiguous proposal. Though I did not realize it at the time, this proposal is competing with https://github.com/tc39/proposal-partial-application, as the two syntax's cannot exist in the same language. I still find the scala-like pattern useful, and not all hope is lost. There is a babel macro https://www.npmjs.com/package/param.macro which was inspired by scala's `_`. Side note, they solve the issue of `g(f(?))` creating either `x => g(f(x))` or `g(x => f(x))` by splitting the logic into two different macros: `it` and `_`. ``` import { _, it } from 'param.macro' const arrayOfObj = [{ n: 1 }, { n: 2 }, { n: 3}] arrayOfObj.map(it.n) // yeilds // arrayOfObj.map(x => x.n) arrayOfObj.map(_.n) // yeilds // x => arrayOfObj.map(x.n) ``` If anyone is interested in keeping the proposal alive/modifying it, feel free to put a pull request on my repo https://github.com/andykais/proposal-placeholder-syntax. Otherwise, I don't believe I see a lot of interest in it according to this discussion.