3.6.3 String Types

Static Semantics

1

{string type}A one-dimensional array type whose component type
is a character type is called a string type.

2/2

{AI95-00285-01}
[There are three two
predefined string types, String, and Wide_String, and Wide_Wide_String,
each indexed by values of the predefined subtype Positive; these are
declared in the visible part of package Standard:]

51 String literals (see 2.6
and 4.2) are defined for all string types.
The concatenation operator & is predefined for string types, as for
all nonlimited one-dimensional array types. The ordering operators <,
<=, >, and >= are predefined for string types, as for all one-dimensional
discrete array types; these ordering operators correspond to lexicographic
order (see 4.5.2).

Inconsistencies With Ada 83

8.a

{inconsistencies with Ada 83} The
declaration of Wide_String in Standard hides a use-visible declaration
with the same defining_identifier.
In rare cases, this might result in an inconsistency between Ada 83 and
Ada 95.

Incompatibilities With Ada 83

8.b

{incompatibilities with Ada 83} Because
both String and Wide_String are always directly visible, an expression
like

8.c

"a" < "bc"

8.d

is now ambiguous, whereas in Ada 83 both string
literals could be resolved to type String.

Extensions to Ada 83

8.e

{extensions to Ada 83} The
type Wide_String is new (though it was approved by ARG for Ada 83 compilers
as well).

Wording Changes from Ada 83

8.f

We define the term string type as a natural
analogy to the term character type.

Inconsistencies With Ada 95

8.g/2

{AI95-00285-01}
{inconsistencies with Ada 95} The
declaration of Wide_Wide_String in Standard hides a use-visible declaration
with the same defining_identifier.
In the (very) unlikely event that an Ada 95 program had depended on such
a use-visible declaration, and the program remains legal after the substitution
of Standard.Wide_Wide_String, the meaning of the program will be different.

Extensions to Ada 95

8.h/2

{AI95-00285-01}
{extensions to Ada 95} The
type Wide_Wide_String is new.