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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-18 15:16:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!tank.news.pipex.net!pipex!newspeer.clara.net!news.clara.net!peernews!peer.cwci.net!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail Sender: mjw@golux Newsgroups: comp.lang.ada Subject: Bounds of Slice's return value From: Matthew Woodcraft Message-ID: <87bsfrcksf.fsf@chiark.greenend.org.uk> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 18 Jan 2002 23:16:16 +0000 NNTP-Posting-Host: 213.107.104.73 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 1011395783 213.107.104.73 (Fri, 18 Jan 2002 23:16:23 GMT) NNTP-Posting-Date: Fri, 18 Jan 2002 23:16:23 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:19085 Date: 2002-01-18T23:16:16+00:00 List-Id: Ada.Strings.Unbounded.Slice returns a Standard.String. Am I guaranteed anything about the bounds of this string? In particular, if I run the following program, should I always get '1', or is an implementation allowed to choose a different value? with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; procedure Slice_Return_Value is U : Unbounded_String := To_Unbounded_String ("hello"); S : String := Slice (U, 2, 3); begin Put_Line (Integer'Image (S'first)); end Slice_Return_Value; -M-