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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9c9db81a63ddf1fe X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: extended membership tests (branch) Date: Thu, 31 Mar 2011 16:10:26 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7dc23d58-4a48-4444-90cd-7f9786b19aad@i14g2000yqe.googlegroups.com> <4d94aba4$0$7656$9b4e6d93@newsspool1.arcor-online.net> <247eef65-9ff3-4268-af73-e74d092c1e82@k10g2000prh.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1301605830 3961 69.95.181.76 (31 Mar 2011 21:10:30 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 31 Mar 2011 21:10:30 +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.5931 Xref: g2news2.google.com comp.lang.ada:19605 Date: 2011-03-31T16:10:26-05:00 List-Id: "Adam Beneschan" wrote in message news:247eef65-9ff3-4268-af73-e74d092c1e82@k10g2000prh.googlegroups.com... On Mar 31, 9:28 am, Georg Bauhaus wrote: >> for b in b1 in b1 .. b1 loop >> null; >> end loop; > >See AARM 3.5(3.a). "for b in" has to be followed by either a subtype >name, a 'Range attribute, or two "simple expressions" with .. between >them. In the last case, the bounds must be "simple expressions", not >general expressions. The syntax of simple_expressions doesn't allow >membership tests (except in parentheses). So the above is illegal. >This rule has been there since Ada 95. Right. The only incompatibility involved with this new feature is with case statements. A membership test now needs to be parenthesized, as it did in Ada 83, but Ada 95 and Ada 2005 allowed it not to be in parens. when X in Y => -- Illegal in Ada 83 and Ada 2012, legal in Ada 95 and Ada 2005. when (X in Y) => -- OK everywhere. The reason is that something like: when X in Y | Z => would be ambiguous without the parens. Beyond that, the likelyhood of writing something like this is pretty small anyway (why write a case statement on type Boolean??). Randy. -- Adam