comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Quantified expressions: no support for restriction predicates
Date: Mon, 30 Apr 2012 08:57:11 -0700 (PDT)
Date: 2012-04-30T08:57:11-07:00	[thread overview]
Message-ID: <19032073.760.1335801431421.JavaMail.geo-discussion-forums@ynlt11> (raw)
In-Reply-To: <796413.773.1335612600942.JavaMail.geo-discussion-forums@vbai3>

On Saturday, April 28, 2012 4:30:00 AM UTC-7, phil.c...@lineone.net wrote:
> 
> Drat.  I knew about the parentheses.  (Personally, I would have liked parentheses to be required only when there is a syntactic ambiguity.  I suppose that is so often, you may as well have them all the time.)

I have a vague memory of seeing code like this in a textbook, a long time ago.  I think it was in some version of Algol:

   if if if if A then B else C then D else E then F else G then
      ...

Although this isn't syntactically ambiguous, it is definitely migraine-inducing.  Based on this, I'm glad they decided to require the parentheses.  Although code like this shouldn't be written, at least a reader would have a fighting chance of understanding something like

   if (if (if (if A then B else C) then D else E) then F else G) then

                          -- Adam



  parent reply	other threads:[~2012-04-30 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  0:29 Quantified expressions: no support for restriction predicates phil.clayton
2012-04-27 23:43 ` Randy Brukardt
2012-04-28 11:30   ` phil.clayton
2012-04-29 14:03     ` Robert A Duff
2012-04-29 18:37       ` phil.clayton
2012-04-29 19:35         ` Robert A Duff
2012-05-01  2:48           ` Randy Brukardt
2012-05-01 11:35           ` phil.clayton
2012-04-30 15:57     ` Adam Beneschan [this message]
2012-05-01 11:14       ` phil.clayton
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox