comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: String Problem
Date: Thu, 08 Sep 2005 01:14:16 GMT
Date: 2005-09-08T01:14:16+00:00	[thread overview]
Message-ID: <IfMTe.2473$9x2.1703@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <sa4u0gwpms7.fsf@snoopy.microcomaustralia.com.au>

Brian May wrote:

> What is a "null string"?

ARM 2.6:

"A null string literal is a string_literal with no string_elements between the 
quotation marks."

and, from the Examples section:

'""    --  a null string literal'

ARM 4.2:

"The evaluation of a string_literal that is a primary yields an array value 
containing the value of each character of the sequence of characters of the 
string_literal, as defined in 2.6. The bounds of this array value are determined 
according to the rules for positional_array_aggregates (see 4.3.3), except that 
for a null string literal, the upper bound is the predecessor of the lower bound.

"For the evaluation of a string_literal of type T, a check is made that the 
value of each character of the string_literal belongs to the component subtype 
of T. For the evaluation of a null string literal, a check is made that its 
lower bound is greater than the lower bound of the base range of the index type. 
The exception Constraint_Error is raised if either of these checks fails."

ARM A.3.2:

" Each of the names To_Lower, To_Upper, and To_Basic refers to two functions: 
one that converts from Character to Character, and the other that converts from 
String to String. The result of each Character-to-Character function is 
described below, in terms of the conversion applied to Item, its formal 
Character parameter. The result of each String-to-String conversion is obtained 
by applying to each element of the function's String parameter the corresponding 
Character-to-Character conversion; the result is the null String if the value of 
the formal parameter is the null String. The lower bound of the result String is 1."

Similar uses of the phrase "null string" may be found in the descriptions of the 
various Ada.Strings.* packages, and in other places. It does not seem to ever be 
described. The meaning seems to be a value of type String with 'Length = 0, or 
a[n] [Un]Bounded_String such that the function Length returns 0. It could also 
be defined as a string that is equal to "".

-- 
Jeff Carter
"I like it when the support group complains that they have
insufficient data on mean time to repair bugs in Ada software."
Robert I. Eachus
91



  reply	other threads:[~2005-09-08  1:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-06 21:15 String Problem TC
2005-09-06 21:28 ` Hyman Rosen
2005-09-07 19:33   ` Tapio Marjom�ki
2005-09-07 21:34     ` Ludovic Brenta
2005-09-08 13:25     ` Marc A. Criley
2005-09-08 17:25     ` Martin Krischik
2005-09-07 16:45 ` Martin Krischik
2005-09-07 21:53 ` Brian May
2005-09-08  1:14   ` Jeffrey R. Carter [this message]
2005-09-08  7:23     ` Dmitry A. Kazakov
replies disabled

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