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.129.85.149 with SMTP id j143mr3749902ywb.46.1472074330726; Wed, 24 Aug 2016 14:32:10 -0700 (PDT) X-Received: by 10.157.13.19 with SMTP id 19mr525500oti.15.1472074330557; Wed, 24 Aug 2016 14:32:10 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!c52no10734998qte.1!news-out.google.com!d68ni37921ith.0!nntp.google.com!f6no12719680ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Aug 2016 14:32:10 -0700 (PDT) In-Reply-To: <83ea6bec-e581-4d64-87e5-2617f76e3e4b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=174.28.146.45; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 174.28.146.45 References: <68b89d71-dd92-4b9c-adb9-476a7caa64cf@googlegroups.com> <83ea6bec-e581-4d64-87e5-2617f76e3e4b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Subtype predicates From: Shark8 Injection-Date: Wed, 24 Aug 2016 21:32:10 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31552 Date: 2016-08-24T14:32:10-07:00 List-Id: On Wednesday, August 24, 2016 at 3:18:47 PM UTC-6, Anh Vo wrote: > On Wednesday, August 24, 2016 at 9:45:52 AM UTC-7, Shark8 wrote: > > On Wednesday, August 24, 2016 at 7:06:10 AM UTC-6, AdaMagica wrote: > > > Am Dienstag, 23. August 2016 22:14:30 UTC+2 schrieb Anh Vo: > > > > type Human_Life_Span_Type is range 0 .. 130=20 > > > > with Default_Value =3D> Human_Life_Span_Type'First; > > >=20 > > > No, I think it's the rule that the name of the entity declared in a d= eclaration (here Human_Life_Span_Type) may not be used again in the same de= claration. (You cannot use something that is to be defined recursively in t= he definition.) > > >=20 > > > I just cannot find the RM chapter and verse. > >=20 > > I think it's different for aspects -- similar that Rosen's Trick the na= me of the declaration is referent to the instance of the type. So we could = say something like: > >=20 > > -- A string of upper-case letters followed by a single digit. > > Subtype ID_String is new String > > with Dynamic_Predicate =3D>=20 > > (For all Index in ID_String'Range =3D>=20 > > (if Index /=3D ID_String'Last > > then ID_String(Index) in 'A'..'Z' > > else ID_String(Index) in '0'..'9' > > ) > > ); > >=20 > >=20 > > And since [some] aspects are essentially attribute-specification clause= s (eg "Size =3D> 8" =3D "For T'Size use 8;") there is some sense in thinkin= g it is/should-be legit. >=20 > The 3.5 56.3/3 says that the Default_Value shall be static. Thus, S'First= did not comply with Static Semantics. The compiler error should have compl= ained about aspect "Default_Value" requires static expression instead of pr= efix of "First"... This caused the confusion in the first place. Why wouldn't 'First (on the discrete-type) be considered Static? It's known= at compile-time when the compiler chooses the representation.