tc39 / proposal-call-this

A proposal for a simple call-this operator in JavaScript.
https://tc39.es/proposal-call-this/
MIT License
121 stars 5 forks source link

Specify how this interacts with the PFA proposal #29

Open dead-claudia opened 1 day ago

dead-claudia commented 1 day ago

Ref: https://github.com/tc39/proposal-call-this#pfa-syntax

The most obvious syntax I can think of would be receiver~>fn~(). And just in general substituting ~> for any . property access.

js-choi commented 9 hours ago

I agree that call-this syntax and PFA syntax are probably compatible with one another, as in receiver~>fn~().

As you probably know, PFA syntax has faced an uphill battle with the Committee, being seen as too niche for the a “heavy” solution like syntax. This proposal has also faced similar headwinds.

It would be cool if we could find a real-life codebase in which call-this syntax and PFA syntax would both be useful—i.e., “why would we want to be able to write receiver~>fn~()”.