CVS difference for ais/ai-00252.txt

Differences between 1.8 and version 1.9
Log of other versions for file ais/ai-00252.txt

--- ais/ai-00252.txt	2003/10/29 00:41:41	1.8
+++ ais/ai-00252.txt	2003/12/07 05:00:31	1.9
@@ -1,4 +1,4 @@
-!standard 04.01.03 (09)                               03-10-23  AI95-00252/06
+!standard 04.01.03 (09)                               03-12-03  AI95-00252/07
 !standard 04.01.03 (15)
 !standard 06.03.01 (10)
 !class amendment 00-12-04
@@ -24,25 +24,25 @@
 is to be applied. Identifying both the package and the object is to some extent
 redundant, and makes object-oriented programming in Ada 95 wordier than
 necessary, and/or encourages heavy use of potentially confusing "use" clauses.
-Eliminating this redundancy would make object-oriented programming less-error
-prone, while also clarifying what object is the controlling object.
+Eliminating this redundancy would make object-oriented programming less
+error-prone, while also clarifying what object is the controlling object.
 
 !proposal
 
 We propose a syntactic shorthand Object.Operation(...) as an equivalent to
 Package.Operation(Object, ...) where "Package" is the package in which Object's
 type (or covering thereof) is declared. The equivalence would be based on a
-"use"-like visibility model, where after the ".", primitive and classwide
+"use"-like visibility model, where after the ".", primitive and class-wide
 operations from the package in which an object's type is declared, as well as
-classwide operations from packages in which types that "cover" the object's
+class-wide operations from packages in which types that "cover" the object's
 type are declared, would be effectively "use" visible. Further, the first
 parameter to the operations made "use" visible would (implicitly) be the object
 preceding the ".". This syntactic shorthand would be provided for objects of a
-tagged type, or objects designating a tagged type. NOTE: We considered
+tagged type, or objects designating a tagged type. Note: We considered
 generalizing this to allow non-tagged types to use this shorthand, but this
-become complex when the type is an access type, since both the access type
+becomes complex when the type is an access type, since both the access type
 itself, and its designated type must be considered. Furthermore, the benefit
-is lower since there is no issue of classwide operations for non-tagged types,
+is lower since there is no issue of class-wide operations for non-tagged types,
 so all the "interesting" operations are all from a single package.
 
 The "use"-like visibility model ensures that the operations made visible would
@@ -52,13 +52,8 @@
 made visible would all overload one another, rather than having operations from
 one package hide another.
 
-The visible components are considered prior to the (implicitly) use-visible
-declarations. As usual, the "normally" visible components can hide the
-use-visible declarations, but the use-visible declarations cannot hide each
-other (they only overload each other).
-
 Because of access parameters, if the type of the prefix is an access-to-tagged
-type, the package(s) in which the designated type and classwide types that
+type, the package(s) in which the designated type and class-wide types that
 cover the designated type would be "use"d. Furthermore, to preserve the model
 that "." can result in an implicit dereference, an interpretation of the prefix
 as an implicit dereference is coupled with a "use" of the packages in which the
@@ -73,6 +68,12 @@
 penalizing the user who actually declares an (aliased) object on the stack
 rather than using the heap.
 
+'Access must not be applied to the view of the subprogram created by this
+shorthand, nor can we allow a renaming-as-body, since this would imply that one
+parameter of the call is already bound, while the others are not. Defining the
+convention to be Intrinsic for the this view of the subprogram prevents these
+complications.
+
 One way of describing what is happening is that operations declared in the
 package immediately enclosing a tagged type declaration that have the type (or
 "access" type or type'Class) as their first parameter, are implicitly
@@ -82,7 +83,7 @@
 "beaujolais" effects.
 
 Note that if the prefix type is neither tagged nor access to tagged, no
-shorthand is defined. If the type is tagged, it makes available the classwide
+shorthand is defined. If the type is tagged, it makes available the class-wide
 operations from the packages where "coverings" are declared, plus the
 primitives from the package where the type itself is declared. If the type is
 an access-to-tagged type, it makes available the operations that would have
@@ -90,10 +91,10 @@
 
 !wording
 
-Add the following after paragraph 4.1.3(9):
+Add the following after 4.1.3(9):
 
   * A view of a subprogram whose first formal parameter is of a tagged type
-    or is an access parameter designating a tagged type.
+    or is an access parameter whose designated type is tagged.
 
     The prefix (after any implicit dereference) shall resolve to denote an
     object or value of a specific tagged type T or class-wide type T'Class. The
@@ -104,17 +105,17 @@
     of these types. The designator of the subprogram shall not be the same as
     that of a component of the tagged type visible at the point of the
     selected_component. The selected_component denotes a view of this
-    subprogram that omits the first formal paramete.
+    subprogram that omits the first formal parameter.
 
-Add the following after para 4.1.3(15) of dynamic semantics:
+Add the following after 4.1.3(15):
 
-    For a selected_component with a tagged prefix and selector that denotes a
-    view of a subprogram, a call on the view denoted by the selected_component
-    is equivalent to a call on the underlying subprogram with the first actual
-    parameter being provided by the object or value denoted by the prefix (or
-    the Access attribute of this object or value if the first formal is an
-    access parameter), and the remaining actual parameters given by the
-    actual_parameter_part, if any.
+    For a selected_component with a tagged prefix and selector_name that
+    denotes a view of a subprogram, a call on the view denoted by the
+    selected_component is equivalent to a call on the underlying subprogram
+    with the first actual parameter being provided by the object or value
+    denoted by the prefix (or the Access attribute of this object or value if
+    the first formal is an access parameter), and the remaining actual
+    parameters given by the actual_parameter_part, if any.
 
 Add the following after 6.3.1(10):
 
@@ -128,8 +129,8 @@
 students, where it made OOP awkward to always identify (or "use") the specific
 package in which a dispatching operation was declared, particularly when the
 operation was inherited, and hence only implicitly declared in that package.
-Furthermore, the rules for calling classwide operations and primitive operations
-were significantly different, where the classwide operation was not inherited,
+Furthermore, the rules for calling class-wide operations and primitive operations
+were significantly different, where the class-wide operation was not inherited,
 and hence "remains" in the original package where it was declared, whereas
 the primitive operations were inherited, and hence got carried along into
 the package where the type was declared. The tendency was to "use" every
@@ -137,7 +138,7 @@
 significantly add to the confusion.
 
 We considered an Object'Operation(...) syntax, but that was felt to introduce
-possible conflicts with implementation-dependent attributes. Also, the "."
+possible conflicts with implementation-defined attributes. Also, the "."
 notation had the additional nice feature that a primitive function could be
 used to effectively provide a "read only" component, with the familiar "."
 syntax. Also, using the "." notation allows primitives defined outside a
@@ -147,9 +148,9 @@
 consistent.
 
 We considered only making primitive operations visible, but there are
-situations where an abstraction uses a classwide operation very much like a
+situations where an abstraction uses a class-wide operation very much like a
 primitive operation. For example in Claw, whether a given operation is
-classwide or primitive is not particularly relevant to how it is used (though
+class-wide or primitive is not particularly relevant to how it is used (though
 of course it is relevant to how it is handled in type extensions). The
 "package"-oriented approach, as opposed to the "primitive"-oriented approach,
 may also fit more cleanly into existing overload resolution algorithms, since
@@ -166,14 +167,14 @@
 means that changing from one form of the call to the other could potentially
 change the operation called.
 
-Adding the implicit .all and "'Access" seem like
-useful capabilities, without significantly complicating the proposal.
+The implicit .all and "'Access" are added because they seem like useful
+capabilities which do not significantly complicate the proposal.
 
 We talk about "covering" types rather than "ancestor" types for two reasons.
 One is that it is only operations on class-wide types that are being imported
 from packages other than the one in which the type itself is declared. Second,
 the notion of "covers" will presumably generalize better if we adopt the notion
-of abstract interfaces (see the multiple inheritance Amendment AI).
+of abstract interfaces (see AI-251).
 
 Note that operations on class-wide types can be used even if the package in
 which they are declared is not "with"ed. This is part of the whole point. A
@@ -198,7 +199,7 @@
     type T is tagged ...
     -- implicit declaration of T'Class
     procedure Prim(X : in out T);
-    procedure Classwide(X : in out T'Class; Y : Integer);
+    procedure Class_Wide(X : in out T'Class; Y : Integer);
 end P;
 
 with P;
@@ -218,7 +219,7 @@
     Obj.Prim;         -- call on inherited primitive
     Obj.Prim2(True);  -- call on primitive
     CObj.Prim;        -- dispatching call
-    Obj.Classwide(Y => 77);  -- call on classwide op
+    Obj.Class_Wide(Y => 77);  -- call on class-wide op
     if CObj.Prim3 > 33.5 then  -- dispatching call on primitive function
         ...
     end if;
@@ -230,7 +231,7 @@
 package P3 is
     type T3 is new P2.T2 with ...
     procedure Prim4(A : access T3; C : Character);
-      -- a primitive of T3 using an access param
+      -- a primitive of T3 using an access parameter
 end P3;
 
 with P3;
@@ -243,8 +244,9 @@
     Ptr : P4.AT3 := new ...;
 begin
     Ptr.Prim;             -- Implicit dereference, equivalent to Ptr.all.Prim
-    Ptr.Prim4(C => 'x');  -- No implicit dereference; "P3" package "use"ed
-                          --  because desig type declared there
+    Ptr.Prim4(C => 'x');  -- No implicit dereference; operation from "P3"
+                          -- package can be used because desigated type
+                          -- declared there
 
 end AccMain;
 
@@ -259,7 +261,7 @@
 corresponding entry, entry family, or protected subprogram.>
 @dinst
 @xbullet<A view of a subprogram whose first formal parameter is of a tagged
-type or is an access parameter designating a tagged type.
+or is an access parameter whose designated type is tagged.
 
 The @fa<prefix> (after any implicit dereference) shall resolve to denote an
 object or value of a specific tagged type @i<T> or class-wide type @i<T>'Class.
@@ -270,7 +272,7 @@
 of these types. The designator of the subprogram shall not be the same as
 that of a component of the tagged type visible at the point of the
 @fa<selected_component>. The @fa<selected_component> denotes a view of this
-subprogram that omits the first formal paramete.>
+subprogram that omits the first formal parameter.>
 
 !corrigendum 4.1.3(15)
 
@@ -280,13 +282,13 @@
 object denoted by the @fa<prefix> has this component. The exception
 Constraint_Error is raised if this check fails.
 @dinst
-For a @fa<selected_component> with a tagged prefix and selector that denotes a
-view of a subprogram, a call on the view denoted by the selected_component
-is equivalent to a call on the underlying subprogram with the first actual
-parameter being provided by the object or value denoted by the prefix (or
-the Access attribute of this object or value if the first formal is an
-access parameter), and the remaining actual parameters given by the
-@fa<actual_parameter_part>, if any.
+For a @fa<selected_component> with a tagged @fa<prefix> and @fa<selector_name>
+that denotes a view of a subprogram, a call on the view denoted by the
+@fa<selected_component> is equivalent to a call on the underlying subprogram
+with the first actual parameter being provided by the object or value denoted
+by the @fa<prefix> (or the Access attribute of this object or value if the
+first formal is an access parameter), and the remaining actual parameters given
+by the @fa<actual_parameter_part>, if any.
 
 !corrigendum 6.3.1(10)
 
@@ -294,9 +296,9 @@
 @xbullet<a subprogram declared immediately within a @fa<protected_body>.>
 @dby
 @xbullet<a subprogram declared immediately within a @fa<protected_body>;>
-@xbullet<the view of a subprogram denoted by a selected_component whose prefix
-denotes an object or value of a tagged type, and whose selector_name
-denotes a subprogram operating on the type (see 4.1.3).>
+@xbullet<the view of a subprogram denoted by a @fa<selected_component> whose
+@fa<prefix> denotes an object or value of a tagged type, and whose
+@fa<selector_name> denotes a subprogram operating on the type (see 4.1.3).>
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent