comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Quantified Expressions: "some"
Date: Fri, 19 Nov 2010 18:48:13 +0100
Date: 2010-11-19T18:48:13+01:00	[thread overview]
Message-ID: <4ce6b85d$0$6879$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <UZmdnSgQyt529HjRRVn_vwA@giganews.com>

On 18.11.10 18:58, Peter C. Chapin wrote:

> John Barnes outlines his objection to the vertical bar in a message
> dated September 15, 2010. Two of his objections would also apply to ':'
> as well ("too weak a symbol" and "=> is better because SPARK uses the
> same symbol for the same purpose.")

More fun with arrows.  The AI started from the usual Such That (|) notation:

  (for all I in A'First .. T'Pred(A'Last) | A (I) <= A (T'Succ (I)))


With "=>" replacing "|", this becomes

  (for all I in A'First .. T'Pred(A'Last) => A (I) <= A (T'Succ (I)))

Slightly reformatted:

  (for all I in A'First .. T'Pred(A'Last)
      => A (I) <=
      A (T'Succ (I)))


This is nothing new, just venerable pointy syntax. There has always been,
for example, Boolean'Array (1 => 3 <= N).

But! The expression structure seems rather more likely now,
as it will appear frequently in Post aspects, one example being upper
bounds on a parameter.  The sequence of characters "=> X <=" is
a bit odd, because on the one hand, the "arrows" are so
close together, and symmetrical, but on the other hand, the readers
must doubly distinguish between them to understand the program;
doing so, they must be alert and

(a) know that "=>" is just an arrow for associations(*), and

(b) know that its very mirror, "<=" is defined at a very different
linguistic level, that of relational operators.

This *is* confusing (and is an opportunity for condescension of
Him Who Knows Ada Well), even though this piece of obfuscation is old,
if rarely used in the past.

I guess, then, one Would recommend a pair of parentheses:

  (for all I in A'First .. T'Pred(A'Last) => (A (I) <= A (T'Succ (I))))

OK.  However, by the same token, the pair could be used for "in (3 | 4)"
and Such That could stay as "|".

__
(*) better not to have written any Prolog recently...



  reply	other threads:[~2010-11-19 17:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17  0:03 Quantified Expressions: "some" Georg Bauhaus
2010-11-17  6:31 ` AdaMagica
2010-11-17  8:25   ` Niklas Holsti
2010-11-17 12:29     ` Peter C. Chapin
2010-11-17 13:38       ` Georg Bauhaus
2010-11-17 10:46   ` Dmitry A. Kazakov
2010-11-17 12:05     ` (see below)
2010-11-17 13:38       ` Dmitry A. Kazakov
2010-11-17 14:16         ` Georg Bauhaus
2010-11-17 14:20           ` Dmitry A. Kazakov
2010-11-17 16:14             ` J-P. Rosen
2010-11-17 17:28               ` Dmitry A. Kazakov
2010-11-18  1:12                 ` Randy Brukardt
2010-11-18  8:47                   ` Dmitry A. Kazakov
2010-11-18  9:48                     ` AdaMagica
2010-11-18 10:07                       ` Dmitry A. Kazakov
2010-11-18 10:27                         ` AdaMagica
2010-11-18 13:24                       ` Niklas Holsti
2010-11-18 15:51                         ` Georg Bauhaus
2010-11-18 17:58                         ` Peter C. Chapin
2010-11-19 17:48                           ` Georg Bauhaus [this message]
2010-11-19 17:51                             ` Georg Bauhaus
2010-11-19 20:03                             ` Vinzent Hoefler
2010-12-19 10:04                               ` Andre
2010-11-17 11:33 ` stefan-lucks
replies disabled

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