Re: Ternary operator enhancement proposal

2019-11-15 Thread Isiah Meadows
Also, this particular use case could be addressed by adding an equivalent of the stage 3 optional chaining operators to the proposed pipeline operator: https://github.com/tc39/proposal-pipeline-operator. In this light, I've also filed an issue there:

Re: Ternary operator enhancement proposal

2019-11-14 Thread Cyril Auburtin
the `do` operator might be good enough ```js const z = do { const z = x?.y?.z; z ? doSomethingWithValue(z) : null; }; ``` On Wed, Nov 13, 2019 at 3:48 PM Claude Pache wrote: > > > Le 13 nov. 2019 à 03:43, devlato a écrit : > > Hey folks, > > not sure if you haven't discussed something

Re: Ternary operator enhancement proposal

2019-11-13 Thread Claude Pache
> Le 13 nov. 2019 à 03:43, devlato a écrit : > > Hey folks, > > not sure if you haven't discussed something similar, but what do you think > about making an enhancement for the ternary operator, to make it more > powerful? > I've created a small explanatory doc on GitHub: >

Re: Ternary operator enhancement proposal

2019-11-13 Thread Michael Luder-Rosefield
I put forward a similar proposal a while back: https://esdiscuss.org/topic/proposal-result-forwarding-ternary-operator -- Dammit babies, you've got to be kind. On Wed, 13 Nov 2019 at 02:46, Jacob Pratt wrote: > Aside from the fact that using a non-reserved identifier

Re: Ternary operator enhancement proposal

2019-11-12 Thread Jacob Pratt
Aside from the fact that using a non-reserved identifier would break back-compatibility, I'm fairly certain pattern matching would allow for not recalculating the value while also being far more readable. On Tue, Nov 12, 2019, 21:43 devlato wrote: > Hey folks, > > not sure if you haven't

Ternary operator enhancement proposal

2019-11-12 Thread devlato
Hey folks, not sure if you haven't discussed something similar, but what do you think about making an enhancement for the ternary operator, to make it more powerful? I've created a small explanatory doc on GitHub: https://github.com/devlato/proposal-ternary-placeholder Warmest regards, Denis