comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: 'for cursor in container.first loop' bug?
Date: Thu, 28 Aug 2014 22:16:31 -0500
Date: 2014-08-28T22:16:31-05:00	[thread overview]
Message-ID: <ltoraf$2bo$1@loke.gir.dk> (raw)
In-Reply-To: lyfvggibpz.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyfvggibpz.fsf@pushface.org...
> While scratching my head over 5.5.2 Generalized Loop Iteration, I looked
> at A.18.32 Example of Container Use[1] and tried compiling with GNAT GPL
> 2014 and GCC 4.9.0. The full example compiled fine, but when I attempted
> the substitution in (29) this happened:

Yes, this is known. Had you used the bleeding edge RM 
(http://www.ada-auth.org/standards/ada2x.html) you would have noticed that 
this example is one of many corrections to Ada 2012. (There is enough that 
WG 9 has ordered us to produce a Corrigendum of fixes by the end of next 
year.)

The story here is simply that your editor (that would me) had for some 
reason gotten the wrong notion of how generalized references worked. He then 
carefully used this wrong notion in RM examples and also in some examples 
that he gave to John Barnes for use in the Rationale. Both the RM and the 
Rationale required correction.

Specifically:

...
>    65.          for C in G (Next).Iterate loop
>    66.             declare
>    67.                E : Edge renames G (Next)(C).all;
No .all here; this should be:
              E : Edge renames G (Next)(C);

and the rest of the errors are a cascade.

There's an extra .all in A.18.32(31/4) as well.

Precisely why I was convinced that we needed that .all will have to remain a 
mystery. The rules are clear enough. (Most likely, some of the examples I 
posted here on cla probably had this misconception as well.)

                                Randy.


  reply	other threads:[~2014-08-29  3:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 17:56 'for cursor in container.first loop' bug? Stephen Leake
2014-08-28 19:56 ` Randy Brukardt
2014-08-29 13:52   ` Stephen Leake
2014-08-28 20:46 ` Simon Wright
2014-08-29  3:16   ` Randy Brukardt [this message]
2014-08-29 14:03   ` Stephen Leake
replies disabled

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