comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Woodcraft <mattheww@chiark.greenend.org.uk>
Subject: Bounds of Slice's return value
Date: 18 Jan 2002 23:16:16 +0000
Date: 2002-01-18T23:16:16+00:00	[thread overview]
Message-ID: <87bsfrcksf.fsf@chiark.greenend.org.uk> (raw)


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-



             reply	other threads:[~2002-01-18 23:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-18 23:16 Matthew Woodcraft [this message]
2002-01-19  1:24 ` Bounds of Slice's return value Jeffrey Carter
2002-01-19 10:45   ` Matthew Woodcraft
2002-01-19 14:32     ` Robert A Duff
2002-01-19 17:19       ` Matthew Woodcraft
2002-01-21 20:19 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox