>>>> "der" == der Mouse <mouse
at rodents.montreal.qc.ca> writes:
> No -- neither in Pascal nor in Algol do statements
end in
> semicolon. Instead, statements are SEPARATED by semicolons. An
> important difference, which PL/1 and C both got wrong, in
> different ways.
der> How did C get it wrong? I think Pascal got it wrong and C got
der> it right, because C did it much more the way humans tend to
der> think of it (and that, after all, is really what a programming
der> language is all about: communicating from a human to a
der> computer.)
der> Of course, in C, semicolons don't terminate statements. They
der> terminate *some* statements - specifically, expression
der> statements.
Exactly. C has a random grammar -- the random rules for semicolons is
just one example. It's especially bad with K&R function headers -- I
dropped those like a hot potato when I learned about ANSI headers,
where I actually had a chance to get the syntax right on the first
attempt.
The Algol/Pascal rule is very simple: semicolons between statements.
Since Algol at least has null statements, if you throw in an extra one
it doesn't hurt, but that's the rule and it works very well.
Thus the program that Cameron quoted as
begin;
writeln('You had best not be dissing Pascal, boy');
end.
should be written without either of the semicolons.
paul