comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How to best make a custom range?
Date: Fri, 8 Nov 2019 16:28:56 -0600
Date: 2019-11-08T16:28:56-06:00	[thread overview]
Message-ID: <qq4q79$a05$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: bbdac1c2-53e9-4b26-a9da-580c988b6b1d@googlegroups.com

"AdaMagica" <christ-usch.grein@t-online.de> 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.




  parent reply	other threads:[~2019-11-08 22:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 17:26 How to best make a custom range? Andrew Shvets
2019-11-04 17:56 ` Shark8
2019-11-04 18:49   ` Andrew Shvets
2019-11-04 19:16   ` Shark8
2019-11-05 14:02     ` Andrew Shvets
2019-11-05 15:10       ` Shark8
2019-11-08 15:55         ` AdaMagica
2019-11-08 16:07           ` AdaMagica
2019-11-08 22:28           ` Randy Brukardt [this message]
2019-11-05 17:14       ` Dmitry A. Kazakov
2019-11-05 17:28         ` Shark8
2019-11-04 18:34 ` Dmitry A. Kazakov
2019-11-04 18:49   ` Andrew Shvets
2019-11-04 18:55     ` Dmitry A. Kazakov
2019-11-04 19:13       ` Shark8
2019-11-04 21:41         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox