From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: 'for cursor in container.first loop' bug? Date: Thu, 28 Aug 2014 22:16:31 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <85y4u8xztj.fsf@stephe-leake.org> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1409282192 2424 69.95.181.76 (29 Aug 2014 03:16:32 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 29 Aug 2014 03:16:32 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:21973 Date: 2014-08-28T22:16:31-05:00 List-Id: "Simon Wright" 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.