CVS difference for ais/ai-00108.txt

Differences between 1.1 and version 1.2
Log of other versions for file ais/ai-00108.txt

--- ais/ai-00108.txt	1998/09/30 00:17:18	1.1
+++ ais/ai-00108.txt	1999/06/26 01:11:13	1.2
@@ -1,5 +1,6 @@
-!standard 13.13.02 (09)                               96-09-15  AI95-00108/02
+!standard 13.13.02 (09)                               99-06-25  AI95-00108/03
 !class binding interpretation 96-04-04
+!status Corrigendum 2000 99-06-02
 !status WG9 approved 96-12-07
 !status ARG approved 7-0-2  96-06-17
 !status work item 96-04-13
@@ -8,7 +9,7 @@
 !difficulty Hard
 !subject Inheritance of Stream Attributes for Type Extensions
 
-!summary 96-04-04
+!summary
 
 For a type extension, the predefined Read attribute is defined to call
 the Read of the parent type, followed by the Read of the non-inherited
@@ -22,7 +23,7 @@
 generated by the Write attribute is not specified, but it must be
 readable by the Read attribute.
 
-!question 96-04-04
+!question
 
 13.1(15) says:
 
@@ -43,14 +44,16 @@
 Are the stream-oriented attributes intended to work properly for
 language defined types such as Unbounded_String?  (Yes.)
 
-!recommendation 96-04-04
+!recommendation
 
 (See summary.)
 
-!wording 96-04-04
+!wording
 
-!discussion 96-07-23
+(See corrigendum.)
 
+!discussion
+
 The general rule for inheritance of type-related representation aspects
 should not apply to the stream attributes of type extensions.  For 'Read
 and 'Write, a rule analogous to the rule for tagged equality makes the
@@ -61,9 +64,9 @@
 There are several problems associated with applying the normal 13.1(15)
 inheritance rules to the stream attributes of tagged types:
 
- 1) Inheriting a 'Read or 'Write of the parent type as-is for 
-    the 'Read or 'Write of a type extension will ignore any new 
-    components added in the extension part.  A rule analogous 
+ 1) Inheriting a 'Read or 'Write of the parent type as-is for
+    the 'Read or 'Write of a type extension will ignore any new
+    components added in the extension part.  A rule analogous
     to the one for the equality operator makes more sense.
     In particular, the default 'Read or 'Write for a type extension
     should be defined to do the 'Read or 'Write of the parent type
@@ -92,8 +95,75 @@
 default versions will not work.  Therefore, for these types, the
 implementer must provide an explicit version of the Read and Write
 attributes.
+
+!corrigendum 13.13.02(9)
+
+@drepl
+For elementary types, the representation in terms of stream elements is
+implementation defined. For composite types, the Write or Read attribute for
+each component is called in a canonical order. The canonical order of
+components is last dimension varying fastest for an array, and positional
+aggregate order for a record. Bounds are not included in the stream if @i<T> is
+an array type. If @i<T> is a discriminated type, discriminants are included only
+if they have defaults. If @i<T> is a tagged type, the tag is not included.
+@dby
+For elementary types, the representation in terms of stream elements is
+implementation defined. For composite types, the Write or Read attribute for
+each component is called in a canonical order. The canonical order of
+components is last dimension varying fastest for an array, and positional
+aggregate order for a record. Bounds are not included in the stream if @i<T> is
+an array type. If @i<T> is a discriminated type, discriminants are included only
+if they have defaults. If @i<T> is a tagged type, the tag is not included.
+For nonlimited type extensions, the Write or Read attribute for the parent type
+is called, followed by the Write or Read attribute of each non-inherited
+component, in canonical order. For limited derived types, the Write or Read
+attribute for the parent type is called.
+
+!corrigendum 13.13.02(27)
+
+@dinsa
+@xbullet<S'Output then calls S'Write to write the value of @i<Item> to the
+stream. S'Input then creates an object (with the bounds or
+discriminants, if any, taken from the stream), initializes it
+with S'Read, and returns the value of the object.>
+@dinst
+If @i<T> is a derived type, S'Output and S'Input are not inherited from the
+parent type; they are defined in terms of S'Read and S'Write, notwithstanding
+the inheritance rule stated in 13.1.
+
+!corrigendum 13.13.02(36)
+
+@dinsa
+The stream-oriented attributes may be specified for any type via an
+@fa<attribute_definition_clause>. All nonlimited types have default
+implementations for these operations. An @fa<attribute_reference> for one of
+these attributes is illegal if the type is limited, unless the attribute
+has been specified by an @fa<attribute_definition_clause>. For an
+@fa<attribute_definition_clause> specifying one of these attributes, the
+subtype of the Item parameter shall be the base subtype if scalar, and the
+first subtype otherwise. The same rule applies to the result of the Input
+function.
+@dinss
+For every subtype S of a language-defined nonlimited specific type @i<T>, the
+output generated by S'Output or S'Write must be readable by S'Input or
+S'Read, respectively. The object read by S'Input or S'Read must behave as
+the original object for the operations declared in the predefined descendants
+of the unit that declares @i<T>. This rule applies across partitions if the
+implementation conforms to the Distributed Systems Annex.
+
+For every subtype S'Class of a language-defined class-wide type T'Class, the
+attributes S'Class'Write, S'Class'Read, S'Class'Input and S'Class'Output must
+have their predefined definition.
+
+!ACATS test
+
+A C-Test to check that the Read and Write attributes of an extension are
+defined as in this issue should be created. It should also check that the
+Input and Output attributes revert to the predefined versions for an extension.
+Tests to check that language defined nonlimited private types properly support
+'Read and 'Write should also be created.
 
-!appendix 96-04-13
+!appendix
 
 !section 13.13.2(09)
 !subject Missing AI: 'Input/'Output inheritance
@@ -104,20 +174,20 @@
 !discussion
 
 The general rule for inheritance of type-related representation aspects
-should not apply to the stream attributes of type extensions.  
-For 'Read and 'Write, a rule analogous to the rule for tagged equality 
-would make the most sense.  For 'Input and 'Output, no inheritance makes 
+should not apply to the stream attributes of type extensions.
+For 'Read and 'Write, a rule analogous to the rule for tagged equality
+would make the most sense.  For 'Input and 'Output, no inheritance makes
 sense; instead, they should regain their predefined meaning in terms
 of 'Read and 'Write.
 
-This issue was discussed at length in some Ada 95 forum or other 
+This issue was discussed at length in some Ada 95 forum or other
 (perhaps the GNAT team mailing list?).  There are several problems
-associated with applying the normal 13.1(15) inheritance rules to 
+associated with applying the normal 13.1(15) inheritance rules to
 the stream attributes of tagged types:
 
- 1) Inheriting a 'Read or 'Write of the parent type as-is for 
-    the 'Read or 'Write of a type extension will ignore any new 
-    components added in the extension part.  A rule analogous 
+ 1) Inheriting a 'Read or 'Write of the parent type as-is for
+    the 'Read or 'Write of a type extension will ignore any new
+    components added in the extension part.  A rule analogous
     to the one for the equality operator would make more sense.
     In particular, the default 'Read or 'Write for a type extension
     should be defined to do the 'Read or 'Write of the parent type

Questions? Ask the ACAA Technical Agent