Re: Dangling else (Henry Spencer)
5 Mar 2006 02:18:14 -0500

          From comp.compilers

Related articles
[2 earlier articles]
Re: Dangling else (SM Ryan) (2006-02-24)
Re: Dangling else (Russ Cox) (2006-02-24)
Re: Dangling else (Russ Cox) (2006-02-24)
Re: Dangling else (SM Ryan) (2006-03-05)
Re: Dangling else (SM Ryan) (2006-03-05)
Re: Dangling else (=?ISO-8859-1?Q?Jan_Vorbr=FCggen?=) (2006-03-05)
Re: Dangling else (2006-03-05)
Re: Dangling else (Dave Thompson) (2006-03-05)
Re: Dangling else (Dmitry A. Kazakov) (2006-03-06)
Re: Dangling else (Russ Cox) (2006-03-06)
Re: Dangling else (Marco van de Voort) (2006-03-11)
Re: Dangling else (Brian Inglis) (2006-03-11)
Re: Dangling else (2006-03-14)
[6 later articles]
| List of all articles for this month |

From: (Henry Spencer)
Newsgroups: comp.compilers
Date: 5 Mar 2006 02:18:14 -0500
Organization: SP Systems, Toronto, Canada
References: 06-02-154 06-02-168
Keywords: parse, design
Posted-Date: 05 Mar 2006 02:18:14 EST

  our moderator wrote:
>[I don't know anyone who thinks that C's million levels of precedences
>are a good idea...

Bear in mind, though, that attempts to reduce the number of levels have
often been found equally unsatisfactory. Pascal tried, and the result was
counterintuitive cases where certain parentheses, which everyone agrees
ought to be redundant, are in fact necessary.

Some of C's levels are unfortunate historical accidents which wouldn't be
done the same way in a new language. (And if you thought C was bad, C++
has added several *more* levels.) But a certain number are simply needed
for usability.

Mathematics manages quite comfortably with a fairly elaborate precedence
structure -- it's easy to underestimate just how many levels there are in
math notation until you start systematically counting them -- and when
programming languages borrow math notation for expressions, they are well
advised to borrow the precedence structure (or as much of it as they can)
as well.

>How do you like the APL rule that everything binds and associates the same?

An interesting but unsuccessful experiment.
-- is temporarily off the air; | Henry Spencer
mail to henry at instead. |

Post a followup to this message

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