Re: Paren-free heads strawman

2016-02-01 Thread Brendan Eich
Did you read the proposal? http://wiki.ecmascript.org/doku.php?id=strawman:paren_free Yes, it means if you start a condition with '(' you are obligated to use paren-full not paren-free style. :-P /be On Mon, Feb 1, 2016 at 10:20 AM Andreas Rossberg wrote: > This

Re: Re: Paren-free heads strawman

2016-02-01 Thread Alican Çubukçuoğlu
Isn't this very unnatural? If you are into this kind of thing, why don't you code Coffee for example? (Or don't since saving a few keystrokes isn't worth your dignity.) ___ es-discuss mailing list es-discuss@mozilla.org

Re: Paren-free heads strawman

2016-02-01 Thread Brendan Eich
Braces required, see the old strawman. /be On Mon, Feb 1, 2016 at 9:18 AM Andreas Rossberg wrote: > Will > > if x (y) (z); > > parse as > > if (x) ((y)(z)); > > or > > if (x(y)) (z); > > ? And how do you parse it without infinite look-ahead? > > /Andreas > > > On 1

Paren-free heads strawman

2016-02-01 Thread kdex
I've noticed that there's a strawman that has been left untouched for quite a while, namely [strawman:paren_free](http://wiki.ecmascript.org/doku.php?id=strawman:paren_free). It intends to make parentheses in heads optional, making, for instance: ```js if x > 3 { /* … */ } ``` equivalent

Paren-free heads strawman

2016-02-01 Thread kdex
I've noticed that there's a strawman that has been left untouched for quite a while, namely [strawman:paren_free](http://wiki.ecmascript.org/doku.php?id=strawman:paren_free). It intends to make parentheses in heads optional, making, for instance: ```js if x > 3 { /* … */ } ``` equivalent

Re: Paren-free heads strawman

2016-02-01 Thread Bob Myers
I love the paren-free head idea. But as an obsessive user of non-braced single-statement if/for/while bodies, I don't see the advantage of making the head paren-free at the cost of mandating braces for the body. Has either of the following been considered: ```js if i < 3: foo(); if i < 3 do

Re: Paren-free heads strawman

2016-02-01 Thread kdex
Well, try and define "natural" in the context of constructed languages. If this was a question of "naturalness" (whatever that may be), then really any deviation from what the language currently is, is "unnatural". Anyway, we're here to discuss, not to blindly judge. :) Note that the parens

Re: Paren-free heads strawman

2016-02-01 Thread Andreas Rossberg
This refactoring hazard is intimately tied to the infinite look-ahead problem. Teaching a parser to handle the latter case or examples like `if (x) (y) -z {}` correctly is gonna be all but easy. Either backtracking or terrifying grammar refactorings would be needed. On 1 February 2016 at 18:46,

Re: Paren-free heads strawman

2016-02-01 Thread Brendan Eich
On Mon, Feb 1, 2016 at 8:02 AM kdex wrote: > [Douglas Crockford](https://www.youtube.com/watch?v=Nlqv6NtBXcA) and > [Brendan Eich](https://brendaneich.com/2010/11/paren-free/) seem > > to be in favor of making them optional; that's why the strawman exists. > > The strawman exists

Re: Paren-free heads strawman

2016-02-01 Thread Andreas Rossberg
Will if x (y) (z); parse as if (x) ((y)(z)); or if (x(y)) (z); ? And how do you parse it without infinite look-ahead? /Andreas On 1 February 2016 at 17:01, kdex wrote: > Well, try and define "natural" in the context of constructed languages. > > If this was a