CVS difference for ais/ai-00254.txt

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

--- ais/ai-00254.txt	2004/01/26 23:27:45	1.9
+++ ais/ai-00254.txt	2004/05/29 00:38:35	1.10
@@ -1,4 +1,4 @@
-!standard  3.10   (06)                               04-01-26  AI95-00254/07
+!standard  3.10   (06)                               04-05-24  AI95-00254/08
 !standard  3.10   (12)
 !standard  3.7    (09)
 !standard  3.10.2 (13)
@@ -38,13 +38,14 @@
 Furthermore, experience with anonymous access-to-object types has shown that
 they are not as flexible as might have been desired and it is thus proposed
 that they be permitted in more contexts as described in AI-230 and with
-further control over whether they have a null value in AI-231. Similar
-flexibility is hereby proposed for anonymous access-to-subprogram types.
+further control over whether they have a null value as described in AI-231.
+Similar flexibility is hereby proposed for anonymous access-to-subprogram
+types.
 
 !proposal
 
 NOTE: this AI assumes that AI-230 and AI-231 are approved. It is based on
-AI-230/09 and AI-231/07. Changes may be required if these AIs are modified.
+AI-230/12 and AI-231/09. Changes may be required if these AIs are modified.
 
 The key change is that the syntactic form access_definition which currently
 is used solely for anonymous access-to-object types is extended to include
@@ -53,7 +54,7 @@
    access_definition ::=
       [null_exclusion] access [general_access_modifier] subtype mark |
       [null_exclusion] access [protected] procedure parameter_profile |
-      [null exclusion] access [protected] function parameter_and_result_profile
+      [null_exclusion] access [protected] function parameter_and_result_profile
 
 Recall that AI-230 permits access_definition in contexts other than as formal
 parameters. We will first consider the use of anonymous access-to-subprogram
@@ -69,7 +70,7 @@
 is subtype conformant to the formal profile. If a null_exclusion is supplied
 then the actual parameter must not be null (this is a runtime check).
 
-Thus we might have
+Thus within the function Integrate we might have
 
    function F(X: Float) return Float is
    begin
@@ -86,7 +87,7 @@
 
 The accessibility level of such parameters is considered to be infinite.
 This prevents all explicit type conversions on such parameters. Moreover,
-since they are of anonymous type like access-to-object parameters this
+since they are of anonymous type (like access-to-object parameters) this
 implies that assignment of them is forbidden. Note that the infinite
 accessibility level also prevents the writing of Fn.all'Access
 which could otherwise create a hidden type conversion. (These restrictions
@@ -112,11 +113,11 @@
 
 Thus we might have
 
-P: access function (F: Float)return Float renames Fn;
+P: access function (F: Float) return Float renames Fn;
 
-Note that we are renaming the parameter which is an object, we are not
-renaming a subprogram per se. The accessibility level is inherited from the
-renamed object which might or might not be infinite.
+Note that we are renaming the parameter Fn of Integrate which is an object, we
+are not renaming a subprogram per se. The accessibility level is inherited from
+the renamed object which might or might not be infinite.
 
 type R is
    record
@@ -135,13 +136,13 @@
 
 !wording
 
-This assumes wording as already modified by AI-230/09 and AI-231/07.
+This assumes wording as already modified by AI-230/12 and AI-231/09.
 
 Replace 3.7(9) by
 
 The subtype of a discriminant may be defined by an optional null_exclusion and
 a subtype_mark, in which case the subtype_mark shall denote a discrete or
-access subtype, or it may be defined by an access definition. A discriminant
+access subtype, or it may be defined by an access_definition. A discriminant
 that is defined by an access_definition is called an access discriminant and
 is of an anonymous access type.
 
@@ -158,7 +159,7 @@
 
 An access_definition defines an anonymous general access type or an
 anonymous access-to-subprogram type. For a general access type, the subtype
-mark denotes its designated subtype; if the word constant appears,
+mark denotes its designated subtype; if the reserved word constant appears,
 the type is an access-to-constant type; otherwise it is an
 access-to-variable type. For an access-to-subprogram type, the
 parameter_profile or parameter_and_result_profile denotes its designated
@@ -180,7 +181,7 @@
 Replace 4.9.1(2) by
 
 A subtype statically matches another subtype of the same type if they have
-statically matching components. Two anonymous access subtypes statically
+statically matching constraints. Two anonymous access subtypes statically
 match if their designated subtypes statically match or their designated
 profiles are subtype conformant.
 
@@ -195,10 +196,10 @@
 
 Replace 6.1(27) by
 
-*   For access parameters of an access-to-object type, the designated
+*   For any access parameters of an access-to-object type, the designated
     subtype of the parameter type.
 
-*   For access parameters of an access-to-subprogram type, the subtypes of
+*   For any access parameters of an access-to-subprogram type, the subtypes of
     the profile of the parameter type.
 
 Add after 6.3.1(13)
@@ -211,17 +212,16 @@
 Replace 8.5.1(3) by
 
 The type of the object_name shall resolve to the type determined by the
-subtype_mark, or in the case where the type is defined by an access
-definition, to a specific anonymous access type which in the case of an
-access-to-object type shall have the same designated type as that of the
-access definition and in the case of an access-to-subprogram type shall have
-a designated profile which is subtype conformant with that of the access
-definition.
+subtype_mark, or in the case where the type is defined by an access_definition,
+to a specific anonymous access type which in the case of an access-to-object
+type shall have the same designated type as that of the access definition and
+in the case of an access-to-subprogram type shall have a designated profile
+which is subtype conformant with that of the access_definition.
 
 Replace 8.5.1(4) by
 
 The renamed entity shall be an object. In the case of a renaming with an
-access definition of an access-to-object type, then the access definition
+access_definition of an access-to-object type, then the access_definition
 shall be of an access-to-constant type if and only if the renamed object is
 of an access-to-constant type.
 
@@ -301,7 +301,7 @@
 and that Ada 2005 should include the feature.
 
 LSN 1083 suggested two mechanisms: limited access-to-subprogram types and
-access-to-subprogram-parameters. Of these, the second is preferred because
+access-to-subprogram parameters. Of these, the second is preferred because
 (a) it is close to the techniques in Algol 60 and Pascal, and (b) it fits in
 with the existing access parameters. This mechanism is thus proposed here.
 
@@ -312,20 +312,8 @@
    function Do_It(Fn: access function(X: Float) return Float;
                   Lo, Hi: Float);
 end;
-
-If this syntax (which follows that of Pascal) is felt to be undesirably
-convoluted then given the introduction of "named subtypes of anonymous access
-types" we might recast this as
-
-package Integrate is
-   subtype Integrand is access function(X: Float) return Float;
-   function Do_It(Fn: Integrand; Lo, Hi: Float);
-end;
-
-(This problem did not arise with Algol 60 which just omitted the details of
-the formal profile and left the compiler to figure it out at its leisure.)
 
-It some ways it could be argued that Ada 95 made the situation seem worse. In
+In some ways it could be argued that Ada 95 made the situation seem worse. In
 Ada 83, one had to use generics and just put up with it. Ada 95 introduced
 access-to-subprogram types which work for simple situations; however, this
 perhaps led to the expectation that access-to-subprogram types would work for
@@ -464,7 +452,7 @@
 they would be limited, assignment would be disallowed, so
 downward-closure-style parameter passing could be allowed, and would
 be safe.  The compiler would implement limited access-to-subprogram
-types with a static link or display.  Non-limited ones would retain
+types with a static link or display.  Nonlimited ones would retain
 the interoperability-with-C property.  The syntax would be something
 like this:
 
@@ -473,7 +461,7 @@
     procedure Iterate(S: Integer_Set; Action: Integer_Action);
         -- Call Action on each member of S.
 
-Type conversion from limited to non-limited would be illegal.
+Type conversion from limited to nonlimited would be illegal.
 
 Access-to-subprogram parameters would be an extension to access
 parameters (not to be confused with parameters of a named access
@@ -961,8 +949,8 @@
 @dby
 @xbullet<For any access parameters of an access-to-object type, the designated
 subtype of the parameter type.>
-@xbullet<For access parameters of an access-to-subprogram type, the subtypes of
-the profile of the parameter type.>
+@xbullet<For any access parameters of an access-to-subprogram type, the
+subtypes of the profile of the parameter type.>
 
 !corrigendum 6.3.1(13)
 
@@ -1046,7 +1034,7 @@
 !reference RM9X-3.10.2(16);4.0
 !reference AARM-12.3(12.p,12.q);4.0
 !reference LSN-1042 on Accessibility Checks in Generics
-!from Bob Duff $Date: 2004/01/26 23:27:45 $ $Revision: 1.9 $
+!from Bob Duff $Date: 2004/05/29 00:38:35 $ $Revision: 1.10 $
 !discussion
 
 Two issues related to access types and the accessibility rules came
@@ -1459,7 +1447,7 @@
 !topic LSN on Accessibility Checks in Generics
 !key LSN-1042 on Accessibility Checks in Generics
 !reference MS-12;4.6
-!from Bob Duff $Date: 2004/01/26 23:27:45 $ $Revision: 1.9 $
+!from Bob Duff $Date: 2004/05/29 00:38:35 $ $Revision: 1.10 $
 !discussion
 
 This Language Study Note discusses accessibility checks, and their

Questions? Ask the ACAA Technical Agent