J.2 Allowed Replacements of Characters
Syntax
1
The following replacements
are allowed for the vertical line, number sign, and quotation mark characters:
2
A vertical line character (|) can be replaced
by an exclamation mark (!) where used as a delimiter.
3
The number sign characters (#) of a
based_literal
can be replaced by colons (:) provided that the replacement is done for
both occurrences.
3.a/2
To be honest: {
AI95-00285-01}
The intent is that such a replacement works in the Value
, and Wide_Value
, and Wide_Wide_Value
attributes, and in the Get procedures of Text_IO
(and Wide_Text_IO and Wide_Wide_Text_IO as well) }, so that things
like “16:.123:” is acceptable.
4
The quotation marks (") used as string
brackets at both ends of a string literal can be replaced by percent
signs (%) provided that the enclosed sequence of characters contains
no quotation mark, and provided that both string brackets are replaced.
Any percent sign within the sequence of characters shall then be doubled
and each such doubled percent sign is interpreted as a single percent
sign character value.
5
These replacements do not change the meaning of
the program.
5.a
Reason: The original purpose of this
feature was to support hardware (for example, teletype machines) that
has long been obsolete. The feature is no longer necessary for that reason.
Another use of the feature has been to replace the vertical line character
(|) when using certain hardware that treats that character as a (non-English)
letter. The feature is no longer necessary for that reason, either, since
Ada 95 has full support for international character sets. Therefore,
we believe this feature is no longer necessary.
5.b
Users of equipment that still uses | to represent
a letter will continue to do so. Perhaps by next the time Ada is revised,
such equipment will no longer be in use.
5.c
Note that it was
never legal to use this feature as a convenient method of including double
quotes in a string without doubling them — the string literal:
5.d
%"This is quoted."%
5.e/3
{
AI05-0248-1}
is not legal in Ada
(and never was legal) 83,
nor will it be in Ada 95. One has to write:
5.f
"""This is quoted."""
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe