From: John.Goodenough@SEI.CMU.EDU
Subject: IMAGE for non-graphic characters
Date: 14 Mar 88 14:33:36 GMT [thread overview]
Message-ID: <8803141433.AA02147@cs.sei.cmu.edu> (raw)
With respect to the recent question about the image of a nongraphic character,
AI-00239 addresses this issue. This is a non-binding interpretation, meaning
it is recommended, but not enforced, and may be the required position in a
future version of the Standard. I quote from the summary of this commentary:
If ENUM_IO is an instantiation of ENUMERATION_IO for a character type that
contains a non-graphic character, e.g.,
package ENUM_IO is new ENUMERATION_IO (CHARACTER);
then for each non-graphic character (such as ASCII.NUL), ENUM_IO.PUT should
output the corresponding sequence of characters used in the type definition
(e.g., PUT(ASCII.NUL) should output the string "NUL" if SET has the value
UPPER_CASE and WIDTH is less than 4). Furthermore, ENUM_IO.GET should be
able to read the sequence of characters output by ENUM_IO.PUT for a
non-graphic character, returning in its ITEM parameter the corresponding
enumeration value.
Similarly, the image of a non-graphic character (i.e., the result returned
for the attribute designator IMAGE) should be the sequence of characters used
in the type definition of CHARACTER (e.g., CHARACTER'IMAGE(ASCII.NUL) =
"NUL"), and 'VALUE should accept such a string as representing the
corresponding enumeration value.
An implementation conforms to the Standard in this respect if the result
produced by 'IMAGE for a non-graphic character is accepted by 'VALUE, and if
the result (if any) produced by PUT can be read by GET; GET is also allowed
to raise DATA_ERROR when attempting to read any string produced by PUT for a
non-graphic character.
This interpretation is non-binding, i.e., implementers are encouraged to
conform to it but are not required to do so by the validation tests. A
future version of the Standard may incorporate this interpretation.
John Goodenough
Software Engineering Institute
Goodenough@sei.cmu.edu
reply other threads:[~1988-03-14 14:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox