CVS difference for ais/ai-00195.txt

Differences between 1.24 and version 1.25
Log of other versions for file ais/ai-00195.txt

--- ais/ai-00195.txt	2002/06/11 05:15:45	1.24
+++ ais/ai-00195.txt	2002/06/14 23:48:55	1.25
@@ -452,11 +452,6 @@
 equal to those of the actual parameter. Constraint_Error is raised if this
 check fails.
 
-If Constraint_Error is raised during a call on Read because of failure of one
-the above checks, the implementation must ensure that the discriminants of the
-actual parameter of Read are not modified. It is unspecified how this effect is
-achieved.
-
 !corrigendum 13.13.2(36/1)
 
 @drepl
@@ -493,9 +488,13 @@
 
 A stream-oriented attribute for a subtype of a class-wide type T'Class is
 available at places where one of the following conditions is true:
-@xbullet<@i<T> is nonlimited.>
-@xbullet<The attribute is available everywhere within the part of the immediate
-scope of @i<T> where @i<T> is frozen.>
+@xbullet<@i<T> is nonlimited; or>
+@xbullet<@i<T> or its partial view is declared in the visible part of a
+(generic) package, and the corresponding attribute of @i<T> is available
+somewhere within the visible part of the package; or>
+@xbullet<@i<T> or its partial view is declared somewhere other than the
+visible part of a (generic) package, and the corresponding attribute of @i<T>
+is available somewhere within the immediate scope of @i<T>; or
 @xbullet<The attribute has been specified via an
 @fa<attribute_definition_clause>, and the @fa<attribute_definition_clause>
 is visible.>
@@ -521,7 +520,11 @@
 the output generated by S'Output or S'Write shall be readable by S'Input or
 S'Read, respectively. This rule applies across partitions if the implementation
 conforms to the Distributed Systems Annex.
-@dinst
+@dinss
+If Constraint_Error is raised during a call on Read because of failure of one
+the above checks, the implementation must ensure that the discriminants of the
+actual parameter of Read are not modified.
+
 @i<@s8<Implementation Permissions>>
 
 The number of calls performed by the predefined implementation of the stream-
@@ -1005,6 +1008,219 @@
 AI (now that the stream size stuff is out of it, we might even be able to finish
 it). So I recommend that he add this problem to the AI, then put it on the
 agenda for the meeting. (How's that for passing the buck? :-)
+
+****************************************************************
+
+From: Pascal Leroy
+Sent: Friday, May 31, 2002  6:45 AM
+
+Fair enough.  Let me try again (I believe that the following addresses your two
+questions):
+
+A stream-oriented attribute for a subtype of a class-wide type T'Class is
+available at places where one of the following conditions is true:
+
+* T is nonlimited.
+
+* T is a limited private type or a limited private extension, and the
+corresponding attribute of T is available somewhere within the package
+specification where its partial view is declared.
+
+* T doesn't have a partial view, and the corresponding attribute of T is
+available somewhere within the immediate scope of T.
+
+* The attribute has been specified via an @fa<attribute_definition_clause>, and
+the @fa<attribute_definition_clause> is visible.
+
+What do you think?
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Friday, May 31, 2002  12:44 PM
+
+Including within the private part or body?
+
+I have now lost track of why these two bullets can't be reduced to:
+
+  * T is a limited type and the corresponding attribute of T is available.
+
+(i.e. T'Class'Blah is available where T'Blah is available)
+
+Is the problem that within the immediate scope of T itself, we want
+T'Class'Blah to be available *before* T'Blah is available.
+I presume *outside* the immediate scope of T, the above simple rule
+works.  Or is the problem something else?
+
+****************************************************************
+
+From: Pascal Leroy
+Sent: Friday, May 31, 2002  2:52 PM
+
+> Or is the problem something else?
+
+I suggest rereading item 3 of the !discussion of the AI.
+
+The problem is that we must ensure that T'Class'Blah is only available if
+NT'Blah is available for all possible types NT derived from T (including T
+itself), because the 'Class'Blah attribute will dispatch, and if it tries to
+dispatch to a non-available attribute, things will go downhill.
+
+Ignoring private types, the other rules in this AI ensure that, if Blah is
+available for T, it is available for NT.  However, in the presence of
+private types (or extensions) things get nasty because Blah may only be
+available in the private part, and NT doesn't know about that attribute.  I
+originally wrote the AI in a way that made T'Class'Blah unavailable in this
+case, but Randy didn't like it, so I tried to be more clever, and failed
+miserably.
+
+Anyway it is clear that the discussion we are having is not an editorial
+one, so I am going to send this AI back to the ARG once more.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, June 13, 2002  12:32 PM
+
+Pascal proposed:
+
+A stream-oriented attribute for a subtype of a class-wide type T'Class is
+available at places where one of the following conditions is true:
+
+* T is nonlimited.
+
+* T is a limited private type or a limited private extension, and the
+corresponding attribute of T is available somewhere within the package
+specification where its partial view is declared.
+
+* T doesn't have a partial view, and the corresponding attribute of T is
+available somewhere within the immediate scope of T.
+
+* The attribute has been specified via an @fa<attribute_definition_clause>,
+and
+the @fa<attribute_definition_clause> is visible.
+
+
+Tucker wrote:
+
+> > I have now lost track of why these two bullets can't be reduced to:
+> >
+> >   * T is a limited type and the corresponding attribute of T is
+available.
+> >
+> > (i.e. T'Class'Blah is available where T'Blah is available)
+> >
+> > Or is the problem something else?
+
+Pascal responded:
+
+> I suggest rereading item 3 of the !discussion of the AI.
+>
+> The problem is that we must ensure that T'Class'Blah is only available if
+> NT'Blah is available for all possible types NT derived from T (including T
+> itself), because the 'Class'Blah attribute will dispatch, and if it tries
+to
+> dispatch to a non-available attribute, things will go downhill.
+>
+> Ignoring private types, the other rules in this AI ensure that, if Blah is
+> available for T, it is available for NT.  However, in the presence of
+> private types (or extensions) things get nasty because Blah may only be
+> available in the private part, and NT doesn't know about that attribute.
+I
+> originally wrote the AI in a way that made T'Class'Blah unavailable in
+this
+> case, but Randy didn't like it, so I tried to be more clever, and failed
+> miserably.
+
+The original AI made T'Class'Blah illegal for all limited private types.
+That's the vast majority of types, and that essentially denies OOP streaming
+to limited types. I didn't (and still don't) think that is a good idea.
+
+> Anyway it is clear that the discussion we are having is not an editorial
+> one, so I am going to send this AI back to the ARG once more.
+
+The primary problem here is the proposed revised wording has the wrong
+meaning, so it doesn't make sense. The substitution of "somewhere" for
+"anywhere" is wrong.
+
+That's because the point of the rule is that the attribute needs to be
+available anywhere that the type is visible, or we run into the problem that
+Pascal noted. Thus "somewhere" is very wrong, because it allows the
+attribute to be available somewhere in its scope.
+
+But of course "anywhere" alone isn't quite right, either, since it is a
+condition that could never be met:
+
+    type LPriv is tagged limited private;
+    -- LPriv'Write is not available here!
+    procedure Write (AS : Stream_Access; Obj : in out LPRiv);
+    for LPriv'Write use Write;
+    -- LPriv'Write is available here.
+
+So the rule was written as:
+
+@xbullet<The corresponding attribute of @i<T> is available everywhere within
+the part of the immediate scope of @i<T> where @i<T> is frozen.>
+
+This might be confusing, but it is (roughly) right. It's not possible to
+call the attributes before they are frozen, so that is the part of the scope
+that we are interested in.
+
+If there is some part of the scope where the attribute T'Blah is not
+available, then it is possible that there is a derviation NT where NT'Blah
+is not available, and we therefore cannot allow the use of T'Class'Blah
+(otherwise it could dispatch to an unavailable attribute).
+
+The only problem I see with the original wording is that the freezing point
+could be (and probably is) in the private part. That would still allow the
+attribute to be unavailable in some derivations.
+
+Returning to Pascal's proposed wording, I see two problems:
+
+* T is a limited private type or a limited private extension, and the
+corresponding attribute of T is available somewhere within the package
+specification where its partial view is declared.
+
+This would include the private part. It has to be available in the visible
+part, or T'Class'Blah has to be unavailable.
+
+* T doesn't have a partial view, and the corresponding attribute of T is
+available somewhere within the immediate scope of T.
+
+Tuck asks if this could include the body. I don't think so, as you can't
+redefine the attribute after the type is frozen. And it has to be frozen in
+the body. But again, it could include the private part (since the type isn't
+necessarily frozen), and that is no good.
+
+Indeed, I don't think whether or not the type has a partial view is
+particularly relevant. What matters more is whether it is declared in a
+package spec.
+
+So my suggestion is:
+
+A stream-oriented attribute for a subtype of a class-wide type T'Class is
+available at places where one of the following conditions is true:
+
+* T is nonlimited; or
+
+* T or its partial view is declared in the visible part of a (generic)
+package, and the corresponding attribute of T is available somewhere within
+the visible part of the package; or
+
+* T or its partial view is declared somewhere other than the visible part of
+a (generic) package, and the corresponding attribute of T is
+available somewhere within the immediate scope of T; or
+
+* The attribute has been specified via an @fa<attribute_definition_clause>,
+and
+the @fa<attribute_definition_clause> is visible.
+
+
+It's still a bit more confusing than I'd like. Comments?
+
+Sorry about writing all of this, but it seems necessary for me to figure out
+what this all means. And I hate the throw it away afterwards, hoping it will
+help someone else figure it out.
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent