why ; ?

Janice Caron caron800 at googlemail.com
Thu May 8 00:35:42 PDT 2008


2008/5/8 Nick Sabalausky <a at a.a>:
>  Not that I'm advocating any "non-compulsory semicolon" syntax, but couldn't
>  the first one work fine by saying "Newline and semicolon are BOTH
>  interpreted as end-of-statement"? (aside from the issue of "with or without
>  a continue-on-next-line symbol"). Or am I just taking the discusion in a
>  circle?

Yeah, we're going round and round. If I break a line because it's too
long, I absolutely do not want the compiler assuming that means "end
of statement". As numerous examples have shown, it is perfectly
possible for the compiler to misinterpret the programmers intent, and
produce code that does completely the wrong thing.

There are only two ways to avoid this problem:
(1) require semicolons at end of statement
(2) require line breaks which are not end-of-statement to be escaped

Since I don't like (2), I must support (1).



More information about the Digitalmars-d mailing list