CVS difference for ais/ai-00231.txt

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

--- ais/ai-00231.txt	2003/07/26 03:26:00	1.8
+++ ais/ai-00231.txt	2003/09/27 23:19:30	1.9
@@ -1,4 +1,4 @@
-!standard  3.10      (06)                        03-06-22  AI95-00231/04
+!standard  3.10      (06)                        03-09-27  AI95-00231/05
 !standard  3.10      (12)
 !standard  4.6       (49)
 !standard  8.6       (25)
@@ -26,33 +26,41 @@
 Change non-controlling access parameters and access discriminants to
 allow them to have null values.
 
-Introduce a not-null constraint, and an access_constraint syntactic
-category.
+Introduce a "null exclusion," ("not null") and allow it on subtype indications,
+access type definitions, and access definitions. We don't call it a
+"constraint" because doing so creates various wording issues relating to
+"constrained" versus "unconstrained."
 
-Generalize access_definition to allow specification of
-access-to-constant, and a not-null constraint.
+Generalize access_definition to allow specification of access-to-constant, and
+a null exclusion.
 
 !wording
 
-Modify 3.2.2(5) to:
-    constraint ::= scalar_constraint | access_constraint | composite_constraint
+Replace paragraph 3.2.2(3) with:
+    subtype_indication ::=
+      [null_exclusion] subtype_mark [scalar_constraint | composite_constraint]
 
-    access_constraint ::=
-       not_null_constraint | composite_constraint [not_null_constraint]
+Delete paragraph 3.2.2(5).
 
+Modify 3.10(2) to:
+
+    access_type_definition ::=
+        [null_exclusion] access_to_object_definition
+      | [null_exclusion] access_to_subprogram_definition
+
 Modify 3.10(6) to:
 
-    not_null_constraint ::= NOT NULL
+    null_exclusion ::= NOT NULL
 
     access_definition ::=
-       ACCESS [ALL|CONSTANT] subtype_mark [not_null_constraint]
+       [null_exclusion] ACCESS general_access_modifier subtype_mark
 
 Modify 3.10(12) to:
 
     An access_definition defines an anonymous general access type; the subtype
     mark denotes its @i<designated subtype>. If the word @b<constant> appears,
     the type is an access-to-constant type; otherwise it is an
-    access-to-variable type. If a not_null_constraint is present, or the
+    access-to-variable type. If a null_exclusion is present, or the
     access_definition is for a controlling access parameter (see 3.9.2), the
     access_definition defines an access subtype which excludes the null value;
     otherwise the subtype includes a null value. An access_definition is used
@@ -62,19 +70,24 @@
 
 Drop the parenthetical "(named)" from the first sentence of 3.10(13), since in
 our new model, anonymous access types have a null value, even though a subtype
-might exclude the null value.
+might exclude the null value. Drop the "named" from the last sentence of
+3.10(13) as well, since anonymous access types can have allocators.
 
-Modify 3.10(15), to:
-    An access_constraint includes a not_null_constraint, a
-    composite_constraint, or both. An access_constraint with a
-    composite_constraint is compatible with an unconstrained access subtype if
-    the composite_constraint is compatible with the designated subtype. An
-    access_constraint with a not_null_constraint is compatible with an access
-    subtype if the subtype includes a null value. An access value satisfies a
-    composite_constraint imposed on an access subtype if it equals the null
-    value of its type or if it designates an object whose value satisfies the
-    constraint.  An access value satisifes a not_null_constraint imposed on an
-    access subtype if it does not equal the null value of its type.
+Add the following sentence to the end of 3.10(14):
+    The first subtype of a type defined by an access_type_definition excludes
+    the null value if a null_exclusion is present; otherwise, the first subtype
+    includes the null value.
+
+Modify 3.10(15) as follows:
+
+    A composite_constraint is compatible with an unconstrained access subtype
+    if it is compatible with the designated subtype. {A null_exclusion is
+    compatible with an access subtype if the subtype includes a null value.} An
+    access value satisfies a composite_constraint of an access subtype if it
+    equals the null value of its type or if it designates an object whose value
+    satisfies the constraint. {An access value satisifes a null_exclusion
+    imposed on an access subtype if it does not equal the null value of its
+    type.}
 
 Delete paragraph 4.1.4(7) which says that anonymous access types don't
 have a null value.
@@ -90,12 +103,12 @@
 
 !example
 
-    type Non_Null_Ptr is access T not null;
+    type Non_Null_Ptr is not null access T;
 
     procedure Show(X : Non_Null_Ptr);
       -- X guaranteed to not be null
 
-    procedure Pass_By_Ref(Y : access constant Rec not null);
+    procedure Pass_By_Ref(Y : not null access constant Rec);
       -- Pass Y by reference, but don't allow it to be updated;
       -- Guarantee Y is non-null.
 
@@ -143,6 +156,11 @@
 will require explicit initialization. Perhaps a NOTE to this effect should be
 included in 3.10.
 
+Note that the "all" in an access_definition is redundant, since
+anonymous access types are always considered "general" access
+types. However, it was felt more confusing to disallow use of "all"
+for anonymous access types, even though it has no effect.
+
 !appendix
 
 Randy Brukardt  00-04-13
@@ -263,4 +281,19 @@
 
 *************************************************************
 
+From: Randy Brukardt
+Sent: Saturday, September 27, 2003  6:15 PM
+
+In the appendix of AI-231, I see a note from Adam Beneschan that 6.1(24) will
+need to be changed (because it says "access-to-variable"). I think the AI needs
+to include that, right?
+
 *************************************************************
+
+From: Randy Brukardt
+Sent: Saturday, September 27, 2003  6:17 PM
+
+3.7(9) has the same wording, and will need a similar fix.
+
+*************************************************************
+

Questions? Ask the ACAA Technical Agent