CVS difference for ais/ai-00108.txt

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

--- ais/ai-00108.txt	2000/06/21 23:39:08	1.10
+++ ais/ai-00108.txt	2000/07/08 02:40:52	1.11
@@ -1,4 +1,4 @@
-!standard 13.13.02 (09)                               00-06-01  AI95-00108/06
+!standard 13.13.02 (09)                               00-07-07  AI95-00108/07
 !standard 13.13.02 (27)
 !standard 13.13.02 (36)
 !class binding interpretation 96-04-04
@@ -10,7 +10,7 @@
 !priority High
 !difficulty Hard
 !qualifier Error
-!subject Inheritance of Stream Attributes for Type Extensions
+!subject Inheritance of stream attributes for type extensions
 
 !summary
 
@@ -24,8 +24,8 @@
 Default stream attributes are never inherited; rather, the default
 implementation for the derived type is used.
 
-The stream attributes must work properly for every language defined
-nonlimited type.  For language defined private types, the output
+The stream attributes must work properly for every language-defined
+nonlimited type.  For language-defined private types, the output
 generated by the Write attribute is not specified, but it must be
 readable by the Read attribute.
 
@@ -58,7 +58,7 @@
 values.  How many discriminants does Child'Write write? (One.)
 
 Are the stream-oriented attributes intended to work properly for
-language defined types such as Unbounded_String?  (Yes.)
+language-defined types such as Unbounded_String?  (Yes.)
 
 !recommendation
 
@@ -109,14 +109,44 @@
 case, we must take care to insure that the attribute for the new type does
 handle the extension component. We do this by requiring an attribute
 to be directly specified if it has a limited extension component that does
-not have an implementation of Write or Read and the parent type does have a
-(specified) implementation of Write or Read. (A alternative would be to inherit
-the original operation unmodified, but this would silently ignore the extension
-components. This could cause hard-to-find bugs as the components would probably
-revert to default values when they are input.) This rule is similar to the way
-that functions of type extensions are inherited: they aren't inherited, they
-must be overridden (except that we only invoke it when we can't do the right
-thing automatically).
+not have an implementation of Write or Read and the parent type has a
+(specified) implementation of Write or Read. (An alternative would be to
+inherit the original operation unmodified, but this would silently ignore
+the extension components. This could cause hard-to-find bugs as the components
+would probably revert to default values when they are input.) This rule is
+similar to the way that functions of type extensions are inherited: they
+aren't inherited, they must be overridden (except that we only invoke it
+when we can't do the right thing automatically, which minimizes the places
+where existing code becomes illegal).
+
+   package P is
+      type T is limited tagged ...;
+      for T'Read use ...;
+
+      type Der is new T with null record;  --  OK (no extension components,
+                                           --  T'Read is effectively inherited)
+
+      type Der_Int is new T with -- OK (non-limited extension components,
+                                 --  T'Read is inherited with the additional
+                                 --  components added)
+      record
+         Int : Integer;
+      end record;
+
+      protected type Protect_Type is ... -- Note: no 'Read specified.
+
+      type Der_Protect_Type is new T with -- Illegal unless
+                                    -- Der_Protect_Type'Read is specified;
+                                    -- we can't compose T'Read, as
+                                    -- Protect_Type'Read can't be called.
+      record
+          PT : Protect_Type;
+      end record;
+   end P;
+
+Simply making the operation uncallable doesn't work, as the operations can be
+dispatched. If, in the above example, Der_Protect_Type couldn't be called,
+problems would arise if T'Class'Read was called on a Der_Protect_Type object.
 
 Clearly, the properties of the default implementation for the stream
 attributes can change for derived types (as in the example given in
@@ -124,17 +154,17 @@
 implementation for an attribute, rather than inheriting a default
 implementation from the parent type.
 
-For language defined nonlimited private types, the International Standard
+For language-defined nonlimited private types, the International Standard
 does not say whether the stream-oriented attributes must work properly.
 It seems that they ought to. For many such types, the default version will work
 properly. However, for a type like Unbounded_String, which is almost
-certainly implemented as a data structure involving pointers, the
+certainly implemented as a data structure involving access values, the
 default versions will not work. Therefore, for these types, the
 implementer must provide an explicit version of the Read and Write
 attributes.
 
 The wording takes advantage of the newly defined "operational attributes"
-(see DR-0009 [AI-00137]) to say that whether operational attributes are
+(see 8652/0009 [AI-00137]) to say whether operational attributes are
 inherited depends on the attribute. This simplifies the wording by
 eliminating the need to describe a long list of exceptions to an inheritance
 rule that we want only in some cases, and provides future flexibility.
@@ -181,25 +211,25 @@
 @dinst
 If an operational aspect is @i<specified> for an entity (meaning that it is
 either directly specified or inherited), then that aspect of the entity is as
-specified. Otherwise, the aspect of the entity has the default value
-determined by the specific aspect.
+specified. Otherwise, the aspect of the entity has the default value for
+that aspect.
 
 !corrigendum 13.3(75)
 
 @drepl
 @xhang<@xterm<S'External_Tag>S'External_Tag denotes an external string
-representation for S'Tag; it is of type String. External_Tag may be specified
+representation for S'Tag; it is of the predefined type String. External_Tag may be specified
 for a specific tagged type via an @fa<attribute_definition_clause>; the
 expression of such a clause shall be static. The default external tag
-representation is implementation-defined. See 3.9.2 and 13.13.2.>
+representation is implementation defined. See 3.9.2 and 13.13.2.>
 @dby
 @xhang<@xterm<S'External_Tag>S'External_Tag denotes an external string
-representation for S'Tag; it is of type String. External_Tag may be specified
+representation for S'Tag; it is of the predefined type String. External_Tag may be specified
 for a specific tagged type via an @fa<attribute_definition_clause>; the
 expression of such a clause shall be static. The default external tag
-representation is implementation-defined. See 3.9.2 and 13.13.2. The value
+representation is implementation defined. See 3.9.2 and 13.13.2. The value
 of External_Tag is never inherited; the default value is always used unless
-it is directly specified for a type.>
+a new value is directly specified for a type.>
 
 !corrigendum 13.13.02(9)
 
@@ -212,25 +242,25 @@
 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 untagged derived types, the Write or Read attribute of the parent type is
-inherited as specified in 13.1; otherwise, the default implementation of the
-attribute is used. For tagged derived types, the Write or Read attribute is not
-inherited; the default implementation is always used.
+For untagged derived types, the Write and Read attributes of the parent type
+are inherited as specified in 13.1; otherwise, the default implementations of
+these attributes are used.
+The default implementation of Write and Read attributes is defined as follows:
 
-The default implementation of Write and Read attributes is defined as follows:@hr
 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
+each component is called in a canonical order, which 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 type extensions, the Write or Read attribute for the parent type
 is called, followed by the Write or Read attribute of each component of the
 extension part, in canonical order. For a limited type extension, if the
-attribute of any ancestor type has been directly specified and the attribute of
-any ancestor type of any of the limited extension components has not been
-specified, the attribute of @i<T> shall be directly specified.
+attribute of any ancestor type of @i<T> has been directly specified and the
+attribute of any ancestor type of the type of any of the extension components
+which are of a limited type has not been specified, the attribute of @i<T>
+shall be directly specified.
 
 !corrigendum 13.13.02(25)
 
@@ -238,13 +268,10 @@
 Unless overridden by an @fa<attribute_definition_clause>, these subprograms
 execute as follows:
 @dby
-For untagged derived types, the Output or Input attribute of the parent type
-is inherited as specified in 13.1; otherwise, the default implementation of
-the attribute is used. For tagged derived types, the Output or Input attribute
-is not inherited; the default implementation is always used.
-
-The default implementation of the Output and Input operations execute as
-follows:
+For untagged derived types, the Output and Input attributes of the parent type
+are inherited as specified in 13.1; otherwise, the default implementations of
+the attributes are used. The default implementation of the Output and Input
+operations execute as follows:
 
 !corrigendum 13.13.02(36)
 
@@ -268,25 +295,19 @@
 @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.
-
+function.@hr
+@i<@s8<Implementation Requirements>>@hr
 For every subtype S of a language-defined nonlimited specific type @i<T>, the
 output generated by S'Output or S'Write shall be readable by S'Input or
-S'Read, respectively. The object read by S'Input or S'Read shall behave as
-the original object for the operations declared in the language-defined
-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
-have their predefined definition.
+S'Read, respectively. This rule applies across partitions if the implementation
+conforms to the Distributed Systems Annex.
 
 !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
+Tests to check that language-defined nonlimited private types properly support
 'Read and 'Write should also be created.
 
 !appendix
@@ -1392,13 +1413,28 @@
 Input is a function after all, and limited functions aren't very useful.
 
 ****************************************************************
+
+From: Randy Brukardt
+Sent: Friday, July 07, 2000 7:44 PM
 
-Editor's note to himself:
 
-After the Potsdam meeting, (if this has been approved):
+While editing DR-40, I noticed a minor glitch in the last sentence of
+13.13.2(9). The problem is that the sentence twice uses "ancestor type" without
+identifying what type the ancestor type is of (and the two uses are different).
 
--- om AI-00195;
--- above to AI-00195;
--- tions?
+I suggest adding a few extra words to fix this (the insertions are marked with
+{}):
 
+For a limited type extension, if the attribute of any ancestor type {of @i<T>}
+has been directly specified and the attribute of any ancestor type {of the type}
+of any of the extension components which are of a limited type has not been
+specified, the attribute of @i<T> shall be directly specified.
+
+This sentence is a real mouthful, but I believe it has the correct effect. If
+anyone has an improvement to this sentence, or an objection to my change, please
+speak up *now*.
+
+			Randy.
+
 ****************************************************************
+

Questions? Ask the ACAA Technical Agent