Re: Dangling else

=?ISO-8859-1?Q?Jan_Vorbr=FCggen?= <jvorbrueggen-not@mediasec.de>
5 Mar 2006 02:17:24 -0500

          From comp.compilers

Related articles
Dangling else borneq@nborneq.nospam.pl (borneq) (2006-02-19)
Re: Dangling else haberg@math.su.se (2006-02-19)
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)
[5 later articles]
| List of all articles for this month |
From: =?ISO-8859-1?Q?Jan_Vorbr=FCggen?= <jvorbrueggen-not@mediasec.de>
Newsgroups: comp.compilers
Date: 5 Mar 2006 02:17:24 -0500
Organization: MediaSec Technologies GmbH
References: 06-02-168 06-02-171
Keywords: parse, syntax
Posted-Date: 05 Mar 2006 02:17:24 EST

> I haven't used APL much, but troff expressions have the same
> rule--everything left to right, equal precedence--and there I find it
> jarring to read expressions like 1+2*3 as 9.


If a language doesn't have precedence levels, then such expressions
should be disallowed. This is how occam2 does it - you need explicit
parentheses everywhere. A bit of a nuisance, sometimes, that's for
sure - but consistent and, if you take FP expressions into account,
perhaps an improvement from a numerical point of view.


> I think that C makes some bad choices for its precedence levels (and
> assigning left-to-right precedence to what should be nonassociative
> operators) but I still think that precedence levels are useful.
> Mathematicians don't seem to be giving up on them any time soon.


But they have only very few widely accepted precendence levels. The problem
with the C set is that nobody can remember them, let alone remember them
correctly. And a language that doesn't take human cognitive deficits into
account is just badly designed, IMO.


Jan



Post a followup to this message

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