Version 1.3 of ais/ai-00174.txt

Unformatted version of ais/ai-00174.txt version 1.3
Other versions for file ais/ai-00174.txt

!standard 13.13.02 (09)          00-11-28 AI95-00174/01
!class confirmation 96-11-16
!status deleted 00-11-28
!status received 96-11-16
!priority Low
!difficulty Easy
!subject (Deleted)
!summary
The question that this AI asks has been answered in AI-00108.
!question
!response
!appendix

!section 13.13.2(09)
!subject Are 'Read and 'Write guaranteed to be "inverses" for predefined types?
!reference RM95-13.13.2(9)
!from Norman Cohen
!reference 96-5750.a Norman H. Cohen 96-11-7>>
!discussion

Recently, as I wrote a program making use of Unbounded_String'Read and
Unbounded_String'Write, it occurred to me that I might be treading on thin
ice.

13.13.2(1) makes clear the intention that if T'Write disassembles a given
object of type T into a byte stream, T'Read will reconstruct an equivalent
object.  However, this is not expressed formally.  I see two loopholes that
ought to be closed by a confirmation:

13.13.2(9) says, "For elementary types, the representation in terms of
stream elements is implementation defined."  This implies, but does not
state explicitly, that there IS a unique stream-element representation for
a value of an elementary type T, that T'Write generates this
representation, and that T'Read constructs a value from this
representation.  (In contrast, the paragraph goes on to describe the
behavior of 'Read and 'Write for composite types operationally, in terms of
the behavior of these procedures, rather than structurally, in terms of the
contents of the stream.)

Nothing is said about whether an implementation can override the predefined
PT'Read or PT'Write for a private type PT declared in a predefined package
(presumably it can) or whether it is guaranteed that PT'Read reconstructs
an object with the same behavior as the object that PT'Write disassembled
(presumably it is, which means that for some representations of private
types, the predefined 'Read and 'Write MUST be overridden).

****************************************************************

Editor's note, 11/28/2000

Corrigendum 13.13.2(36.1/1) says that the results of 'Output and 'Write must be
readable by 'Input and 'Read for all language-defined types (AI-00108). That
completely covers the question (and the title of the AI). Thus, this AI is
deleted as it is redundant.

Note that the question also sort of asks whether elementary 'Read can
read the result of 'Write. It concludes that the intent is clear, but it is
not stated explicitly. Given that this was not the question of the questioner,
we will ignore it.

****************************************************************

Questions? Ask the ACAA Technical Agent