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,XPRIO autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: class wide iterable (and indexable) Date: Tue, 29 Jan 2019 01:45:26 -0600 Organization: JSA Research & Innovation Message-ID: Injection-Date: Tue, 29 Jan 2019 07:45:27 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="4287"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:55396 Date: 2019-01-29T01:45:26-06:00 List-Id: "Shark8" wrote in message news:f4c1e192-9a24-40d1-abd1-233ef6087658@googlegroups.com... > On Wednesday, January 23, 2019 at 3:47:43 PM UTC-7, Randy Brukardt wrote: >> "Shark8" wrote in message >> news:9eedf818-8bfb-465b-afe5-aa3fb0525948... >> > Wouldn't this be a non-issue if we could Static_Predicate Array-types >> > like >> > so? >> > >> > Type Some_String is Array(Positive range <>) of Character >> > with Static-Predicate => Some_String'First = 1; >> >> The idea of a static predicate is for them to stand-in for proper set >> constraints (I would have preferred the latter, but I was alone on that), >> so >> they don't have anything to do with array bounds. > > What do you mean by "proper set constraints"? [And how would they look?] > Things like {x| x in {2**y where y in 0..15} }? (X in > 1|2|4|8|16|..|32_768) See AI05-0153-2. The idea was that there was a kind of constraint that represented a set. I used "when" in the syntax to reflect a case statement limb: subtype Odd is Natural when 1|3|5|7|9; The main difference semantically from static predicates was that these actually changed the value set, which eliminated (at least in my mind) the oddities with 'First and 'Last that occur for predicates. Otherwise, their pretty much the same (including the banning of arrays and slices to eliminate discontiguous arrays). I was pretty much a group of one with this idea, so the AI was never really vetted. So don't trust it too much. Randy. [Sorry about breaking the thread, I got a bunch of header errors when attempting to send a reply.]