CVS difference for ais/ai-00200.txt

Differences between 1.3 and version 1.4
Log of other versions for file ais/ai-00200.txt

--- ais/ai-00200.txt	2004/04/06 19:56:57	1.3
+++ ais/ai-00200.txt	2004/05/29 00:38:33	1.4
@@ -1,4 +1,4 @@
-!standard 03.02.03 (07)                               04-03-23  AI95-00200/02
+!standard 03.02.03 (07)                               04-05-21  AI95-00200/03
 !class binding interpretation 98-03-27
 !status Amendment 200Y 04-03-24
 !status ARG Approved 9-0-0  04-03-05
@@ -27,52 +27,49 @@
 
    package P is
       type Root is tagged ...
-      -- implicit "="(left, right : Root) return boolean;
-      function Foo (l,r : Root) return boolean;
+      -- implicit "="(left, right : Root) return Boolean;
+      function Foo (l,r : Root) return Boolean;
    end P;
    use P;
 
    generic
       type T is new Root with private;
-      -- implicit "="(left, right : T) return boolean;      -- (1)
-      -- implicit Foo(left, right : T) return boolean;      -- (2)
-      with function "="(l,r : T) returns boolean;           -- (3)
-      with function Foo(l,r : T) returns boolean;           -- (4)
+      -- implicit "="(left, right : T) return Boolean;      -- [1]
+      -- implicit Foo(left, right : T) return Boolean;      -- [2]
+      with function "="(l,r : T) return Boolean;            -- [3]
+      with function Foo(l,r : T) return Boolean;            -- [4]
    package G is
       procedure Test (X : T'class);
    end G;
 
-   function Bar (l,r : Root) return boolean;
+   function Bar (l,r : Root) return Boolean;
 
    package I1 is new G(Root, "=", Foo);
    package I2 is new G(Root, Foo, "=");
    package I3 is new G(Root, Bar, Bar);
 
 In each of the instances of G, the declaration of T declares a new view of
-Root by RM95 12.3(15). The predefined "=" operator (1) is copied and is
-considered primitive by RM95 12.5.1(21) and RM95 3.2.3(3). Likewise, the Foo
-function (2) is copied and is considered primitive by RM95 12.5.1(21) and
-RM95 3.2.3(4). The user-defined "=" operator (3) and Foo function (4)
+Root by 12.3(15). The predefined "=" operator [1] is copied and is
+considered primitive by 12.5.1(21) and 3.2.3(3). Likewise, the Foo
+function [2] is copied and is considered primitive by 12.5.1(21) and
+3.2.3[4]. The user-defined "=" operator [3] and Foo function [4]
 declare new views of the generic actual subprograms specified for each
-instance. The "=" (3) and Foo (4) operations are declared in the same
-declarative region as the predefined ones (1) and (2) and override them by
-RM95 8.3(10). So, it seems that it should be considered primitive, too, by
-RM95 3.2.3(7).
+instance. The "=" [3] and Foo [4] operations are declared in the same
+declarative region as the predefined ones [1] and [2] and override them by
+8.3(10). So, it seems that they should be considered primitive, too, by
+3.2.3(7).
 
-Because the "=" (3) and Foo (4) operations are primitive operations of (a
+Because the "=" [3] and Foo [4] operations are primitive operations of (a
 view of) a tagged type in each of the instances, they should also be
-dispatching operations by RM95 3.9.2(1).
+dispatching operations by 3.9.2(1).
 
-[It is not the intent that formal subprograms should ever be primitive
-operations of a type.]
-
 Note that a similar problem exists for a formal subprogram overriding the
 primitive "=" operator of a formal tagged private type:
 
    generic
       type T is new tagged private;
-      -- implicit "="(left, right : T) return boolean;      -- (1)
-      with function "="(l,r : T) returns boolean;           -- (3)
+      -- implicit "=" (left, right : T) return Boolean;      -- [1]
+      with function "=" (L, R : T) return Boolean;           -- [3]
    package G is
       procedure Test (X : T'class);
    end G;
@@ -80,11 +77,11 @@
    package body G is
       procedure Test (X : T'class) is
       begin
-         ... := (X = X);  -- [Illegal: "=" (3) is not dispatching]
+         ... := (X = X);  -- (Illegal: "=" [3] is not dispatching.)
       end Test;
    end G;
 
-Is the formal function "=" a primitive operation of type T? [No.]
+Is the formal function "=" a primitive operation of type T? (No.)
 
 Also note that a similar problem exists for ordinary subprograms overriding
 primitive operations of a generic formal tagged private or generic formal
@@ -92,36 +89,33 @@
 
    generic
       type T is new Root with private;
-      -- implicit "="(left, right : T) return boolean;      -- (1)
-      -- implicit Foo(left, right : T) return boolean;      -- (2)
+      -- implicit "=" (Left, Right : T) return Boolean;      -- [1]
+      -- implicit Foo (Left, Right : T) return Boolean;      -- [2]
    package G is
-      function "="(l,r : T) returns boolean;                -- (3)
-      function Foo(l,r : T) returns boolean;                -- (4)
+      function "=" (L, R : T) return Boolean;                -- [3]
+      function Foo (L, R : T) return Boolean;                -- [4]
 
-      procedure Test (X : T'class);
+      procedure Test (X : T'Class);
    end G;
 
    package body G is
-      function "="(l,r : T) returns boolean is ... end "=";
+      function "=" (L, R : T) return Boolean is ... end "=";
 
-      function Foo(l,r : T) returns boolean is ... end Foo;
+      function Foo (L, R : T) return Boolean is ... end Foo;
 
-      procedure Test (X : T'class) is
+      procedure Test (X : T'Class) is
       begin
-         ... := (X = X);    -- [Illegal: "=" (3) is not dispatching]
-         ... := Foo(X, X);  -- [Illegal: Foo (4) is not dispatching]
+         ... := (X = X);    -- (Illegal: "=" [3] is not dispatching.)
+         ... := Foo(X, X);  -- (Illegal: Foo [4] is not dispatching.)
       end Test;
    end G;
 
 Are the declarations of "=" and Foo in the visible part of G
 primitive operations of the formal type T? [No.]
 
-So, what subprograms should be executed for calls to the "=" (3) and Foo (4)
+So, what subprograms should be executed for calls to the "=" [3] and Foo [4]
 operations in each of the calls to Test?
 
-[The calls are illegal because the invoked subprograms are not dispatching
-operations.]
-
 !recommendation
 
 The rule given in 3.2.3(7) is not intended to apply to subprograms that
@@ -141,12 +135,12 @@
 !wording
 
 Revise 3.2.3(7) to make it clear that the rule does not apply to
-generic formal types, e.g.:
+generic formal types:
 
-  "{In the case of a nonformal type,} any subprograms not covered above
+  {In the case of a nonformal type,} any subprograms not covered above
   that are explicitly declared immediately within the same declarative
   region as the type and that override (see 8.3) other implicitly
-  declared primitive subprograms of the type."
+  declared primitive subprograms of the type.
 
 !discussion
 
@@ -162,7 +156,7 @@
 declarative region as the formal type (8.1) and of overriding
 an implicitly declared primitive subprogram of the type (8.3(10)).
 
-However, it was never the intent that formal subprograms should ever
+However, it was never the intent that formal subprograms should ever be
 treated as primitive operations of a formal type. In fact, the
 primitive operations for formal nonderived types are explicitly defined
 by 12.5(8) to be the predefined operators of the type, and hence could
@@ -171,7 +165,7 @@
 (12.5.1(21)), but it also would not make sense to include overriding
 formal subprograms in a formal derived type's set of primitives.
 
-in fact, to treat overriding formal subprograms as primitives for a
+In fact, to treat overriding formal subprograms as primitives for a
 formal tagged type would be inconsistent with the dispatching model.
 For example, if the actual subprogram associated with an overriding
 formal subprogram in an instance were not even a primitive of the

Questions? Ask the ACAA Technical Agent