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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to best make a custom range? Date: Fri, 8 Nov 2019 16:28:56 -0600 Organization: JSA Research & Innovation Message-ID: References: <21fa6db8-4b86-459f-bc5a-70993f92c28a@googlegroups.com> <27cb5366-4b3d-4f33-b8ec-2bc71c70780c@googlegroups.com> <530a0f85-158a-4c42-b826-04ae4bd46451@googlegroups.com> Injection-Date: Fri, 8 Nov 2019 22:28:57 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="10245"; mail-complaints-to="news@jacob-sparre.dk" 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.7246 Xref: reader01.eternal-september.org comp.lang.ada:57528 Date: 2019-11-08T16:28:56-06:00 List-Id: "AdaMagica" wrote in message news:bbdac1c2-53e9-4b26-a9da-580c988b6b1d@googlegroups.com... > Am Dienstag, 5. November 2019 16:10:46 UTC+1 schrieb Shark8: >> TYPE Digits is range 0..9; >> SUBTYPE Odds is Digits with Static_Predicate => Odds in 1|3|5|7|9; >> what should Odds'Pred(1) be? 0? Constraint_Error? >> what about Odds'Pos(1) should it be 0, the first item of the subtype? Or >> 1, the position in the parent-type? > > Attributes work on the base type, e.g. > > Natural'Pred (0) = -1 Right, but it's a case-by-case thing as to whether an attribute applies to the type or to the subtype. The ones you're talking about apply to the type (not any subtype), but 'First and 'Last apply to the subtype. Randy.