Re: language design tradeoffs [macro mayhem] (Andrew Dunstan)
Sat, 26 Sep 1992 02:01:44 GMT

          From comp.compilers

Related articles
language design tradeoffs (1992-09-07)
Re: language design tradeoffs [macro mayhem] (1992-09-24)
Re: language design tradeoffs [macro mayhem] (1992-09-25)
Re: language design tradeoffs [macro mayhem] (1992-09-26)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Andrew Dunstan)
Organization: The University of Adelaide
Date: Sat, 26 Sep 1992 02:01:44 GMT
Keywords: C, macros, syntax, comment
References: 92-09-048 92-09-171 (Tom Lane) writes:
|> The real reason that this is such a pain is not macros, it's C's
|> misbegotten syntax. If semicolons were statement separators (a la Pascal)
|> instead of statement terminators, things would work a lot more smoothly.

I can't agree less. The semicolon as statement separator in Pascal can get
to be a real bug sometimes. It also leads to syntactic nonsense. This
compound statement:

x := y;;;;

is composed of 5 statements: the assignement plus a null statement after
each semicolon. Let's please have a semicolon terminator and an explicit
null statement as in Ada.
# Andrew Dunstan
# Department of Computer Science
# University of Adelaide
# South Australia
# net:
[The semicolon as separator (Algol60) vs. as terminator (PL/I) is an old
argument that we're not going to resolve here. My impression is that the
Algol approach is more elegant and makes source transformations, including
macro expansion, easier, while the PL/I approach is easier for humans to
write. Neither is unambiguously better; one's preference usually depends on
what one learned first. Personally, I think that the obvious and intuitive
way to indicate continuations is to put a digit after the initial tab. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.