comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@avercom.net>
Subject: Re: Strings initialised by literals
Date: Sun, 22 Jul 2001 21:30:32 -0400
Date: 2001-07-23T01:29:26+00:00	[thread overview]
Message-ID: <3B5B7E39.79B814F4@avercom.net> (raw)
In-Reply-To: 3B5A2478.460CC8B6@worldnet.att.net



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




  reply	other threads:[~2001-07-23  1:30 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 [this message]
2001-07-23  2:45     ` James Rogers
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