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!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: discontinuous subtype without aspect Date: Mon, 29 Jan 2018 17:24:28 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Mon, 29 Jan 2018 23:24:29 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="13891"; 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: reader02.eternal-september.org comp.lang.ada:50207 Date: 2018-01-29T17:24:28-06:00 List-Id: "Mehdi Saada" <00120260a@gmail.com> wrote in message news:b7590929-1b5f-4e14-b689-c86999142749@googlegroups.com... > I'm happy that non continuous index subtypes will be allowed, > but I wonder why > subtype S is T with STATIC_PREDICATE S in Val1|Val5..Val7 > has been favored instead of plain: > subtype S is T range Val1|Val5..Val7 ? Because a range is contigious! That's a basic property of a range. Note that we don't allow declaring arrays with predicates because we don't want arrays with holes in them (and absolutely don't want slices with different holes in them). I had proposed allowing a "set constraint" rather having static predicates, but most people felt it wasn't necessary. (Argubly, it's the range constraints that are redundant these days, but history [and arrays] prevent getting rid of them altogether.) > but why not Squares_Array : Array_Type := (for I in Val1..Val3|Val5 => I * > I); ".." is a contiguous range. ...because people didn't want set constraints. I still fail to understand why, as you point out, a static predicate is not quite a replacement.