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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a1691a2185bb3e7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-18 17:24:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3C48CAC8.AF186C93@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Bounds of Slice's return value References: <87bsfrcksf.fsf@chiark.greenend.org.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 19 Jan 2002 01:24:29 GMT NNTP-Posting-Host: 209.86.208.149 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1011403469 209.86.208.149 (Fri, 18 Jan 2002 17:24:29 PST) NNTP-Posting-Date: Fri, 18 Jan 2002 17:24:29 PST Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Fri, 18 Jan 2002 17:24:33 PST (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:19090 Date: 2002-01-19T01:24:29+00:00 List-Id: Matthew Woodcraft wrote: > > Ada.Strings.Unbounded.Slice returns a Standard.String. > > Am I guaranteed anything about the bounds of this string? As you noticed, the ARM is silent about this. The ARG is working towards (if they haven't already completed) an AI stating that the bounds should be the same as the indices passed to Slice, to correspond with the bounds of a slice of a String. GNAT noticeably does not do this in the most recent public version (3.13p), though I believe this has been changed in more recent (as yet non-public) versions. See program Strm_Sub, distributed as part of the PragmAda Reusable Components, for an example of using Slice portably even when the lower bound returned is one. -- Jeff Carter "I blow my nose on you." Monty Python & the Holy Grail