CVS difference for ai05s/ai05-0023-1.txt

Differences between 1.1 and version 1.2
Log of other versions for file ai05s/ai05-0023-1.txt

--- ai05s/ai05-0023-1.txt	2006/11/13 08:36:01	1.1
+++ ai05s/ai05-0023-1.txt	2007/04/06 04:37:11	1.2
@@ -1,4 +1,4 @@
-!standard 13.13.2(9/2)                                   06-11-13    AI05-0023-1/01
+!standard 13.13.2(9/2)                                   07-04-05    AI05-0023-1/02
 !class binding interpretation 06-11-13
 !status work item 06-11-13
 !status received 06-06-27
@@ -44,7 +44,67 @@
 
 !wording
 
-TBD.
+Add after 13.13.2(9/2) 
+
+    If T is a discriminated type and its discriminants have defaults then
+    S'Read first reads the discriminants from the stream without modifying
+    Item. S'Read then creates an object of type T constrained by these
+    discriminants. The Read attribute for each non-discriminant component
+    of this object (not of Item) is then called in canonical
+    order as described above. Finally, the value of this object is
+    converted to the subtype of Item and is assigned to Item. Normal default
+    initialization and finalization take place for this object.   
+    
+In 13.13.2(27/2) replace
+    S'Input then creates an object...
+with
+    S'Input then creates an object of type T...
+
+Append to the end of 13.13.2(27/2)
+    If T has discriminants, then this object is constrained if and only if
+    T has discriminants without defaults (that is, if and only if discriminants
+    were read from the stream).
+
+Add after 13.13.2(38)
+
+         Implementation Permissions
+         
+    If T is a discriminated type and its discriminants have defaults then
+    in some cases an execution of the default implementation of S'Read is
+    not required to create an object of type T. The discriminant values that
+    are read in may be checked against the corresponding discriminant values
+    of Item. If they are equal, then no object of type T need be created and
+    Item may be used instead. If they are not equal and Item is a
+    constrained variable, then Constraint_Error may be raised at that point,
+    before any further values are read from the stream and before the object
+    of type T is created.
+    
+    If T is a discriminated type and its discriminants have defaults and if
+    an execution of the default implementation of S'Input will, at
+    the point of its call to S'Read, execute the default implementation of
+    S'Read, then the two executions are allowed to proceed as if
+    the discriminants of T did not have defaults. This allows the combined
+    executions of S'Input and S'Read to create one object of type T instead
+    of two. If this option is exercised, then
+        - The discriminants are read from the stream by S'Input, not S'Read.
+        - S'Input declares an object of type T constrained by
+          the discriminants read from the stream, not an unconstrained object.
+        - The discriminant values which S'Read would normally have read from
+          the stream are read from Item instead. 
+        - The permissions of the preceding paragraph then apply and no object
+          of type T need be created by the execution of S'Read.
+    
+Questions:
+1) When we say that "the value of this object ... is assigned to Item",
+   does it need to be explicitly stated that this is an assignment operation?
+   Does the list of assignment operations in 5.2(3) need to be updated? I
+   think not.
+   
+2) Does it need to be stated more explicitly that the permission to treat a
+   type with defaults as though it does not have defaults only applies in
+   the case where S'Input calls S'Read and does not apply in the case
+   where some other caller calls S'Read?
+
 
 !discussion
 

Questions? Ask the ACAA Technical Agent