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!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Subtype predicates Date: Wed, 24 Aug 2016 14:54:20 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <68b89d71-dd92-4b9c-adb9-476a7caa64cf@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 24 Aug 2016 21:54:28 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="d7c030f56102b58a2c16dea977db88bb"; logging-data="5032"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tW27xlEGSQkC4knTehXTT+mKxVsM/5j8=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: <68b89d71-dd92-4b9c-adb9-476a7caa64cf@googlegroups.com> Cancel-Lock: sha1:raJ437OrFwXerrFAUQg3rlcynFA= Xref: news.eternal-september.org comp.lang.ada:31553 Date: 2016-08-24T14:54:20-07:00 List-Id: On 08/24/2016 06:06 AM, AdaMagica wrote: > Am Dienstag, 23. August 2016 22:14:30 UTC+2 schrieb Anh Vo: >> type Human_Life_Span_Type is range 0 .. 130 >> with Default_Value => Human_Life_Span_Type'First; > > No, I think it's the rule that the name of the entity declared in a declaration (here Human_Life_Span_Type) may not be used again in the same declaration. (You cannot use something that is to be defined recursively in the definition.) > > I just cannot find the RM chapter and verse. No, it's because of ARM 13.1.1(12/3): "If the associated declaration is a type_declaration, within the aspect_definition ... the name of the first subtype denotes the current instance of the type (see 8.6)." For a declaration: V : Human_Life_Span_Type; the current instance is V, so this says V's default value is V'First. Since you can't apply 'First to a scalar object, the aspect is in error. -- Jeff Carter "He had no conception of the instrument. He was blowing into it." Take the Money and Run 135