Proposal: `if-else` and `switch` as expressions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal: `if-else` and `switch` as expressions

Shelby Moore
I was told to post this here.

The proposal is nicely formatted over here:

https://github.com/Microsoft/TypeScript/issues/10841

Please discuss and someone consider championing this change to EMCAScript.

I won't be following discussion here, because I am not familiar with this
discussion list.
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: `if-else` and `switch` as expressions

Caitlin Potter
You might be interested in the "do-expressions" feature in v8. I'm not sure how much it's been discussed in the committee, but it's implemented (partially) in V8, so you could experiment with that. Not sure if it does what you want in the switch case, but maybe.

> On Sep 10, 2016, at 4:59 PM, Shelby Moore <[hidden email]> wrote:
>
> I was told to post this here.
>
> The proposal is nicely formatted over here:
>
> https://github.com/Microsoft/TypeScript/issues/10841
>
> Please discuss and someone consider championing this change to EMCAScript.
>
> I won't be following discussion here, because I am not familiar with this
> discussion list.
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: `if-else` and `switch` as expressions

kdex
You could also use babel's stage-0 preset to experiment with do-expressions.

On 09/11/2016 06:18 PM, Caitlin Potter wrote:

> You might be interested in the "do-expressions" feature in v8. I'm not sure how much it's been discussed in the committee, but it's implemented (partially) in V8, so you could experiment with that. Not sure if it does what you want in the switch case, but maybe.
>
>> On Sep 10, 2016, at 4:59 PM, Shelby Moore <[hidden email]> wrote:
>>
>> I was told to post this here.
>>
>> The proposal is nicely formatted over here:
>>
>> https://github.com/Microsoft/TypeScript/issues/10841
>>
>> Please discuss and someone consider championing this change to EMCAScript.
>>
>> I won't be following discussion here, because I am not familiar with this
>> discussion list.
>> _______________________________________________
>> es-discuss mailing list
>> [hidden email]
>> https://mail.mozilla.org/listinfo/es-discuss
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: `if-else` and `switch` as expressions

Rick Waldron
In reply to this post by Caitlin Potter
In addition to Cait's recommendation, I'd suggest proving out the grammar before presenting a proposal. Babel provides mechanisms for defining experimental syntax extensions, which can then be used as evidence to support proposal discussion.

It's very important to remember that syntax additions have an extremely high cost-for-admission.

Rick
On Sun, Sep 11, 2016 at 12:18 PM Caitlin Potter <[hidden email]> wrote:
You might be interested in the "do-expressions" feature in v8. I'm not sure how much it's been discussed in the committee, but it's implemented (partially) in V8, so you could experiment with that. Not sure if it does what you want in the switch case, but maybe.

> On Sep 10, 2016, at 4:59 PM, Shelby Moore <[hidden email]> wrote:
>
> I was told to post this here.
>
> The proposal is nicely formatted over here:
>
> https://github.com/Microsoft/TypeScript/issues/10841
>
> Please discuss and someone consider championing this change to EMCAScript.
>
> I won't be following discussion here, because I am not familiar with this
> discussion list.
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

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