From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:4d43:: with SMTP id x3mr6348998qtv.326.1616110572824; Thu, 18 Mar 2021 16:36:12 -0700 (PDT) X-Received: by 2002:a25:6b44:: with SMTP id o4mr2696414ybm.161.1616110572515; Thu, 18 Mar 2021 16:36:12 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 18 Mar 2021 16:36:12 -0700 (PDT) In-Reply-To: <5b078796-0976-4303-a733-3eaa66637b07n@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=2601:193:4103:71a0:e984:a5fd:bb3c:1a8; posting-account=1tLBmgoAAAAfy5sC3GUezzrpVNronPA- NNTP-Posting-Host: 2601:193:4103:71a0:e984:a5fd:bb3c:1a8 References: <89128f73-fcc5-4e57-8067-d09877ba0211n@googlegroups.com> <6ca041f3-2669-4497-9548-2f17666702a6n@googlegroups.com> <26c44e00-a899-455a-a929-1e23c7935fe3n@googlegroups.com> <9abb081d-a323-466d-9ae8-a2fc8fa24725n@googlegroups.com> <424f7220-abba-49df-8160-17851c336999n@googlegroups.com> <08b15573-0197-4b6e-9411-d0ca0f627f62n@googlegroups.com> <7e1f3203-0fe9-428e-a8ac-411f432dca49n@googlegroups.com> <5b078796-0976-4303-a733-3eaa66637b07n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: array from static predicate on enumerated type From: Matt Borchers Injection-Date: Thu, 18 Mar 2021 23:36:12 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:61619 List-Id: On Thursday, March 18, 2021 at 10:25:02 AM UTC-4, Shark8 wrote: > > Otherwise you have an erroneous program. Similarly, Primes'Succ(12) is = also illegal. Primes'Pred(2) also illegal because there is no prime before = 2 so presumably you have defined your Static_Predicate to enumerate the pri= mes with 2 listed first. > Why?=20 > Given the standard "subtype Natural is Integer range 0..Integer'Last" and= "subtype Positive is Natural range Natural'Succ(Natural'First)..Natural'La= st"=20 > Positive'Pred( 1 ) =3D 0, and no CONSTRAINT_ERROR.=20 > Do you want to break standard Ada usage? I'm certainly not advocating for inconsistency as stated many times. The i= ntegers exist essentially in a continuum with hardware limitations. An enu= meration has a programmer defined first and last value and so does a subtyp= e on Positive with a Static_Predicate. I pulled those ideas out of my head= while I was responding and I admit there should be more discussion on beha= vior if this were to ever be implemented. But that is highly doubtful. Regards, Matt