From: James Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Strings initialised by literals
Date: Mon, 23 Jul 2001 02:45:46 GMT
Date: 2001-07-23T02:45:46+00:00 [thread overview]
Message-ID: <3B5B9072.2276B559@worldnet.att.net> (raw)
In-Reply-To: 3B5B7E39.79B814F4@avercom.net
I agree completely. However, the specific question asked about the
lower bound for a string literal. This should fall into the no
"applicable index constraint" exception you mentioned below.
For that reason I said the lower bound will be 1.
Jim Rogers
Colorado Springs, Colorado USA
Tucker Taft wrote:
>
> James Rogers wrote:
>
> > This is guaranteed by the language.
> >
> > The string type is defined as :
> >
> > type string is array(Positive range <>) of character;
>
> Not all strings start at 1. However, when there is no "applicable index
> constraint" provide by context, then the low bound is the lower bound of
> the index subtype, which in this case is Positive (and Positive'First =
> 1).
> See RM95 4.3(26).
>
> > Jim Rogers
> > Colorado Springs, Colorado
> >
> > Matthew Woodcraft wrote:
> > >
> > > I've a feeling this question came across this newsgroup recently, but
> > > I've been unable to find the thread.
> > >
> > > If I write
> > >
> > > Sample : String := "example";
> > >
> > > Gnat tells me that Sample'First is 1. Is this guaranteed by the
> > > langauge, or does the compiler choose?
> > >
> > > -M-
>
> -Tucker Taft stt@avercom.net
next prev parent reply other threads:[~2001-07-23 2:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-21 18:58 Strings initialised by literals Matthew Woodcraft
2001-07-22 0:52 ` James Rogers
2001-07-23 1:30 ` Tucker Taft
2001-07-23 2:45 ` James Rogers [this message]
2001-07-23 10:55 ` Larry Kilgallen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox