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:128c:: with SMTP id y12mr7972845qti.127.1610015899721; Thu, 07 Jan 2021 02:38:19 -0800 (PST) X-Received: by 2002:a25:db81:: with SMTP id g123mr13118028ybf.277.1610015899484; Thu, 07 Jan 2021 02:38:19 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.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, 7 Jan 2021 02:38:19 -0800 (PST) In-Reply-To: <97bb9444-9787-483d-9eff-e51b5fd58daan@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=20.133.0.13; posting-account=YRfoYAoAAADhSEO2nLYx10QUUvp8akYl NNTP-Posting-Host: 20.133.0.13 References: <1cc09f04-98f2-4ef3-ac84-9a9ca5aa3fd5n@googlegroups.com> <5f0c4c86-bea9-4007-b16e-b4b80749a8b5n@googlegroups.com> <97bb9444-9787-483d-9eff-e51b5fd58daan@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2ef3d694-b382-4274-adc1-92345f31a602n@googlegroups.com> Subject: Re: Lower bounds of Strings From: Stephen Davies Injection-Date: Thu, 07 Jan 2021 10:38:19 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61053 List-Id: Stephen Davies wrote: > subtype Mono_String is String (1 .. <>); > subtype Mono_String is String with First => 1; > subtype Mono_String is String with Slide => True; Dmitry A. Kazakov wrote: > Position-based indices an slices. One could add [] brackets for that > stuff to make C crowd happy. > S [1] - First array element > S (1) - Array element at index 1 Alternatively, to make the distinction more explicit, perhaps: S[Slide:1] - First array element Or maybe a new attribute: S'Slide(1) Reminder, my justification is not only for strings being indexed by numeric literals, e.g.: subtype Some_Range is Positive range 4..5; ... Some_String(Some_Range) -- fails if Some_String'First /= 1