Related articles |
---|
[2 earlier articles] |
Re: Dangling else wyrmwif@tsoft.org (SM Ryan) (2006-02-24) |
Re: Dangling else rsc@swtch.com (Russ Cox) (2006-02-24) |
Re: Dangling else rsc@swtch.com (Russ Cox) (2006-02-24) |
Re: Dangling else wyrmwif@tsoft.org (SM Ryan) (2006-03-05) |
Re: Dangling else wyrmwif@tsoft.org (SM Ryan) (2006-03-05) |
Re: Dangling else jvorbrueggen-not@mediasec.de (=?ISO-8859-1?Q?Jan_Vorbr=FCggen?=) (2006-03-05) |
Re: Dangling else henry@spsystems.net (2006-03-05) |
Re: Dangling else david.thompson1@worldnet.att.net (Dave Thompson) (2006-03-05) |
Re: Dangling else mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2006-03-06) |
Re: Dangling else rsc@swtch.com (Russ Cox) (2006-03-06) |
Re: Dangling else marcov@stack.nl (Marco van de Voort) (2006-03-11) |
Re: Dangling else Brian.Inglis@SystematicSW.ab.ca (Brian Inglis) (2006-03-11) |
Re: Dangling else henry@spsystems.net (2006-03-14) |
[6 later articles] |
From: | henry@spsystems.net (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.
--
spsystems.net is temporarily off the air; | Henry Spencer
mail to henry at zoo.utoronto.ca instead. | henry@spsystems.net
Return to the
comp.compilers page.
Search the
comp.compilers archives again.