proposal-bind-operator icon indicating copy to clipboard operation
proposal-bind-operator copied to clipboard

Is this proposal dead?

Open cshaa opened this issue 7 years ago • 11 comments
trafficstars

Are there any updates on the state of this proposal? I find both the unary and the binary variant to be very useful and esthetic and I would definitely use them. The problem is that it hasn't been getting any updates for ages and the developers of libraries like TypeScript are afraid to implement it, because it's still an early draft. So what is the current status of this feature? Is it going to get promoted to Stage 1 anytime soon?

cshaa avatar Mar 17 '18 14:03 cshaa

I found #44 has active discussion.

saschanaz avatar Mar 17 '18 15:03 saschanaz

Mostly this proposal is near dead. But I think it could revive to two separate proposals:

  • method extraction, suppose the syntax is

    • infix op (which I prefer): a.&b and a[&b], or
    • prefix op: &a.b and &a[b]

    And support const {&b} = a; for destructuring.

  • extension methods/accessors, suppose the syntax is

    • method: a::b()
    • accessor: a::b = 1

hax avatar Mar 19 '18 16:03 hax

@hax I'm confused. How would method extraction work? You'd pull out a method from an object so that you can call it with a specific binding ?

zfrisch avatar Oct 24 '18 18:10 zfrisch

@zfrisch I believe the idea is to extract a method whose receiver remains bound to the object it's extracted from.

mAAdhaTTah avatar Oct 24 '18 19:10 mAAdhaTTah

@zfrisch imagine, const slice = []::slice; slice(arraylike) rather than Array.prototype.slice.call(arraylike)

ljharb avatar Oct 24 '18 19:10 ljharb

@ljharb Wouldn’t that be const slice = [].slice; arraylike::slice()? Or, to use method extraction, const slice = ::Array.prototype.slice.call; slice(arraylike).

charmander avatar Oct 24 '18 21:10 charmander

@charmander to correctly extract it, you'd need

const slice = ::Array.prototype.slice.call;
// or
const slice = ::[].slice.call;

slice(array);

Igorbek avatar Oct 24 '18 22:10 Igorbek

same question + 1

I need this feature.

lake2 avatar Sep 23 '20 05:09 lake2

I'd like to champion this proposal and reshape it. But I first need ask the original champions or tc39 committee whether it was possible.

hax avatar Sep 23 '20 13:09 hax

I loved this feature when it was first introduced with babel. So sad seeing it die.

ackvf avatar Jan 14 '22 01:01 ackvf

FYI: There are currently three active rival TC39 proposals that are trying to subsume this inactive proposal:

There will be some further discussion at the next plenary meeting in January 2022 about these proposals (see “Holistic review of dataflow proposals” in tc39/agendas#1106). So there’s still ongoing activity in this problem space.

js-choi avatar Jan 14 '22 03:01 js-choi