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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.221.39 with SMTP id qb7mr11548003pac.23.1453635517933; Sun, 24 Jan 2016 03:38:37 -0800 (PST) X-Received: by 10.182.166.97 with SMTP id zf1mr156619obb.18.1453635517897; Sun, 24 Jan 2016 03:38:37 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h5no8641990igh.0!news-out.google.com!kr2ni7748igb.0!nntp.google.com!o2no5683888iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 24 Jan 2016 03:38:37 -0800 (PST) In-Reply-To: <56a360fa$0$3294$426a74cc@news.free.fr> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.55.199.98; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.55.199.98 References: <56a360fa$0$3294$426a74cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1e8fb50e-2f28-4052-b6fd-9b2760abc127@googlegroups.com> Subject: Re: Predicate and value attribute From: AdaMagica Injection-Date: Sun, 24 Jan 2016 11:38:37 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:29217 Date: 2016-01-24T03:38:37-08:00 List-Id: Am Samstag, 23. Januar 2016 12:16:12 UTC+1 schrieb Xavier Petit: > Hello, I have some beginner questions. > > subtype Number is String > with Dynamic_Predicate => Positive'Value (Number) in -1 | 5; > > This line compiles and works. I would like some confirmation that 'Value > attribute returns in this case the type Integer and doesn't take into > account Positive subtype, and is why the following is valid: > > Test : Number := "-1"; > > So I should never write "Positive'Value" right ? It's the *type's* attribute, the subtype name is irreleveant (Integer, Natural, Positive all are subtypes of the same anonymous type).