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,aaabba5db6b5df34 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!u-picardie.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Min/Max attribute makes promises it can't keep Date: Tue, 27 Apr 2010 17:46:29 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <98b7e6f2-32ed-465c-9a52-541b7878ca86@y17g2000yqd.googlegroups.com> <9b17e781-f46a-4384-8809-b16602d10114@y30g2000yqh.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1272408391 23776 69.95.181.76 (27 Apr 2010 22:46:31 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 27 Apr 2010 22:46:31 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Original Xref: g2news2.google.com comp.lang.ada:11220 Date: 2010-04-27T17:46:29-05:00 List-Id: "Robert A Duff" wrote in message news:wcczl0o7g13.fsf@shell01.TheWorld.com... > Martin writes: > >> Put (Positive (Positive'Min(Nat, Pos))); > > That works, but I think a qualified expression is better: > > Put (Positive'(Positive'Min(Nat, Pos))); > > By the way, there are lots of attributes that work > like this (use the base subtype). It's not just Min > and Max. Right. Attributes mostly type-related, not subtype-related. The name in the prefix serves to identify the type, not the subtype (there are no named types in Ada, only named subtypes). All of 'Succ, 'Pred, 'Val, and 'Value work this way, and there are probably many, many more. Even 'First and 'Last technically work this way (although it doesn't matter in that case). Randy.