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: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.68.125.229 with SMTP id mt5mr3515580pbb.1.1363368834322; Fri, 15 Mar 2013 10:33:54 -0700 (PDT) MIME-Version: 1.0 Path: q9ni18411pba.1!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!novia!news-peer1!btnet!zen.net.uk!hamilton.zen.co.uk!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeed20.multikabel.net!news.mi.ras.ru!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.x-privat.org!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Mon, 11 Mar 2013 17:32:56 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1363041177 14421 69.95.181.76 (11 Mar 2013 22:32:57 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 11 Mar 2013 22:32:57 +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 Date: 2013-03-11T17:32:56-05:00 List-Id: "Anh Vo" wrote in message news:ec2783d9-1ae6-419e-97ad-12cb9e6c3d74@googlegroups.com... >On Monday, March 11, 2013 1:01:04 PM UTC-7, Robert A Duff wrote: >>> Anh Vo writes: >>> I have read ARM section 3.2.4, Subtype Predicates, I did not see any >>> rules prohibiting from using attribute 'Succ as contained in the code >>> nipet below. I would expect Prime'Succ (3) return 5 for next prime >>> number. However, 4 is returned instead. Is this a correct behavior? > >>It is standard-conforming behavior. Prime'Succ is the same as >>Prime'Base'Succ. >>Many other attributes behave the same way. This has been true since Ada >>83. >>For example, Prime'Succ(1000) = 1001, and does not raise an exception. >>Positive'Image (-10) = "-10". > >Thank you for your clarification. My next question is that should ARM >mention >some thing of that effect regarding subtype predicates. It seems unnecessary, because the behavior is the same as that for constraints. Usually, we only talk specifically about predicates when their behavior is different than constraints -- otherwise we'd be repeating dozens of "obvious" notes. And of course the Standard is not a tutorial for the language. One could argue that 'Pred and 'Succ should have been illegal (like 'First and 'Last are), but it's too late to do that. The reason that 'First and 'Last are illegal is because of potential confusion about the meaning. The same is true here - but the effect is less (it's the same as constraints), so its a marginal case in any event. Randy. P.S. I'm surprised anyone uses those attributes: I almost never do. Now, if we had implemented the procedure version that we talked about briefly, that would have gotten plenty of use.