comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Bounds of Slice's return value
Date: Sat, 19 Jan 2002 01:24:29 GMT
Date: 2002-01-19T01:24:29+00:00	[thread overview]
Message-ID: <3C48CAC8.AF186C93@acm.org> (raw)
In-Reply-To: 87bsfrcksf.fsf@chiark.greenend.org.uk

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



  reply	other threads:[~2002-01-19  1:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-18 23:16 Bounds of Slice's return value Matthew Woodcraft
2002-01-19  1:24 ` Jeffrey Carter [this message]
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