(Almost) everything is expression

Brendan Eich brendan at mozilla.com
Fri Nov 11 15:37:45 PST 2011


On Nov 11, 2011, at 9:49 AM, Mark S. Miller wrote:

> On Fri, Nov 11, 2011 at 9:13 AM, David Herman <dherman at mozilla.com> wrote:
> [...] 
>  Hence my do-expressions:
> 
>     http://wiki.ecmascript.org/doku.php?id=strawman:do_expressions
> 
> or Brendan's subtly-disambiguated-block-statement-expressions:
> 
>     http://wiki.ecmascript.org/doku.php?id=strawman:block_vs_object_literal
> 
> If Brendan's idea can be made to work, and it's not too confusing, I'm pretty sure I'd prefer it over do-expressions.
> [...]
> 
> Interesting. But I think I prefer do expressions over making JS parsing that much more subtle. JS is already much to hard to parse, and other accepted changes are already making it even more so.

Totally agree. I said at the last TC39 meeting that I've given up on arrow function syntax in full since it wants -> {} to return an empty object, while -> {let t = 42; return t*t;} is of course a block-bodied function. Without stronger parsing algorithms than the committee can agree to use for validation, *and* without some unknown way to be future-friendly to object literal extensions, I don't see a solution.

/be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111111/82d5b5e8/attachment.html>


More information about the es-discuss mailing list