Do-Expressions Proposal Stalled?

Peter Jaszkowiak p.jaszkow at gmail.com
Thu Jan 18 18:19:23 UTC 2018


In the issues for the proposal people are discussing making most statements
capable of being used as expressions. Then the value of `do` is less
important, but still necessary for some things:

```
const thing = if (cond) { a; } else { b; };
```

Then you only need `do` to introduce a new block scope.

On Jan 18, 2018 05:43, "T.J. Crowder" <tj.crowder at farsightsoftware.com>
wrote:

> On Thu, Jan 18, 2018 at 12:39 PM, Michael Rosefield <
> rosyatrandom at gmail.com> wrote:
> >
> > Perhaps we could use `do` in front of any statement to make it
> > treatable as an expression; we could have pure `do`, `do while`
> > (as distinguished from `do-while`...), `do switch`, `do for`....
>
> I believe the proposal does that (or will do if it's fleshed out) and that
> `do { ... }` is just a ramification of that when you use a block with it
> rather than another statement. At least, that's my read of the code shown
> in the Further Considerations and unresolved parsing question.
>
> There's just too much left unsaid so far (in the proposal itself) to be
> sure, though.
>
> -- T.J. Crowder
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180118/df30759f/attachment-0001.html>


More information about the es-discuss mailing list