On Apr 17, 2011, at 6:44 PM, Dmitry A. Soshnikov wrote:

> The question is not that it's hard or not. IMO an explicit semicolon is 
> really a syntactic noise in the language. In goes to the early era of 
> C/Pascal, etc.

No, much earlier. Algol 60 used semicolons as separators (not terminators), 
IIRC.


> IMO, the semicolon should be inserted only when there is ambiguous syntactic 
> construction, or, e.g. when you want to put more than one sentence in one 
> line. 

  foo() bar()

is *not* subject to ASI right now. It is plausibly a deletion bug of some kind. 
In my experience it would be a mistake to error-correct it without the hint of 
bar() coming on a later line from foo(), which is what ES1-5.1 all specify.

Changing a future edition to allow this, i.e., to insert ; as an error 
correction, could be done. It would be a relaxation of the syntax rules. But I 
do not think it's a good idea, and it does not help to address the "negative 
space" effect ASI creates, where users expect newline to be significant. It 
doesn't address the restricted production problem either. The primary use-case 
there is

  return
    am_i_overlong_and_the_return_value_or_a_later_expr_stmt();

/be

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

Reply via email to