On Tue, May 15, 2007 at 01:22:48AM +0200, Thomas Wittek wrote:
> Andrew Shitov:
> > If the line of code is not ended with ';' the parser tries first
> > to assume [..]
> 
> Wouldn't that be unambigous?
> 
>  foo = 23
>  bar = \
>        42
> 
> ?
> 
> I think there would be no ambiguities and you only had to add additional
> syntax for the rare cases instead of the common cases.

Without explicit \ to join unterminated lines you get:

  foo = 23
  if x == 7
  { y = 5; z = 6 }

Is that:

  foo = 23
      if x == 7;
  { y = 5; z = 6 }

or:

  foo = 23;
  if x == 7
      { y = 5; z = 6 }

?

With explicit \ to join unterminated lines you just get more
ugliness than having semicolons.  It's also, in many cases,
harder to edit - that's why a trailing comma in a list that
is surrounded by parens, or a trailing semicolon in a block
surrounded by braces, is easier to manage.  The syntax of
the last element is the same as the rest so you can shuffle
the order around easily without having to add a separator to
the end of what used to be the final element and remove the
separator on what is now the final element.

Having punctuation where there is a stop is more natural than
having an explicit marker for "don't stop here, keep going".

-- 

Reply via email to