CVS difference for ais/ai-00231.txt
--- ais/ai-00231.txt 2005/04/13 05:36:58 1.21
+++ ais/ai-00231.txt 2005/06/16 23:47:13 1.22
@@ -1,8 +1,8 @@
-!standard 3.10 (06) 05-02-25 AI95-00231/14
+!standard 3.10 (06) 05-05-10 AI95-00231/15
!standard 3.2 (07)
!standard 3.2 (08)
!standard 3.2.2 (03)
-!standard 3.2.2 (05)
+!standard 3.4 (06)
!standard 3.7 (05)
!standard 3.7 (09)
!standard 3.10 (02)
@@ -68,17 +68,22 @@
Add to 3.2(7):
The set of possible values for an object of an access type can also be
-subjected to a condition that is called a null exclusion (see 3.10).
+subjected to a condition that excludes the null value (see 3.10).
Add to the penultimate sentence of 3.2(8):
...of the values of its type that satisfy its constraint {and, in the case of a
-subtype of an access type, any applicable null exclusion}.
+subtype that excludes null, the values do not include the null value}.
Replace paragraph 3.2.2(3) with:
subtype_indication ::=
[null_exclusion] subtype_mark [constraint]
+Add after 3.4(6):
+
+The first subtype of the derived type excludes null (see 3.10) if and
+only if the parent subtype excludes null.
+
Modify 3.7(5) to:
discriminant_specification ::=
@@ -113,18 +118,10 @@
mark denotes its designated subtype. If the general_access_modifier
constant appears, the type is an access-to-constant type;
otherwise it is an
- 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
+ access-to-variable type. An access_definition is used
in the specification of an access discriminant (see 3.7) or an access
parameter (see 6.1). [NOTE: Drop this last sentence if AI-230 is approved.]
- AARM Note: Controlling access_definitions are null-excluding because it
- is necessary to read the tag to dispatch, and null has no tag. We
- would have preferred to require not null to be specified for such
- parameters, but that would have been too incompatible with Ada 95.
-
Modify 3.10(13) as follows:
For each [(named)] access type, there is [a literal null which has] a null
access value designating no entity at all{, which can be obtained by
@@ -136,27 +133,44 @@
and "an aliased view of an object" in order to get the subprogram away from
the aliased view.
-Add the following sentence to the end of 3.10(14/1):
- 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.
+Add after 3.10(13):
+
+ A null_exclusion in an access_definition, access_type_definition,
+ subtype_indication (see 3.2.2), discriminant_specification (see 3.7),
+ parameter_specification (see 6.1), parameter_and_result_profile (see 6.1),
+ object_renaming_declaration (see 8.5.1), or formal_object_declaration (see
+ 12.4) specifies that the null value does not belong to the access subtype
+ defined by the construct, that is, the access subtype *excludes null*. In
+ addition, the anonymous access subtype defined by the access_definition for
+ a controlling access parameter (see 3.9.2) excludes null. Finally, for a
+ subtype_indication without a null_exclusion, the subtype denoted by the
+ subtype_indication excludes null if and only if the subtype denoted by the
+ subtype_mark in the subtype_indication does.
+
+ AARM Note: Controlling access_definitions exclude null because it
+ is necessary to read the tag to dispatch, and null has no tag. We
+ would have preferred to require not null to be specified for such
+ parameters, but that would have been too incompatible with Ada 95.
Add after 3.10(14/1):
Legality Rules
- A null_exclusion is only allowed in a subtype_indication whose subtype_mark
- denotes an access subtype that includes a null value.
+ A null_exclusion is only allowed in a subtype_indication,
+ discriminant_specification, parameter_specification,
+ parameter_and_result_profile, object_renaming_declaration, or
+ formal_object_declaration whose subtype_mark
+ denotes an access subtype that does not exclude null.
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 any access subtype that includes a null value.} An
+ compatible with any access subtype that does not exclude null.} 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 satisfies a null_exclusion
- imposed on an access subtype if it does not equal the null value of its
+ satisfies the constraint. {An access value satisfies an access
+ subtype that excludes null if it does not equal the null value of its
type.}
Delete paragraph 4.2(7) which says that anonymous access types don't
@@ -178,8 +192,8 @@
value of the target type.
Add to the end of 4.6(51):
- If the target subtype excludes the null value, then a check is made that
- the value is not null.
+ If the target subtype excludes null, then a check is
+ made that the value is not null.
Change 4.9.1(2):
A subtype statically matches another subtype of the same type if they have
@@ -393,20 +407,20 @@
@drepl
The set of possible values for an object of a given type can be subjected to a
-condition that is called a constraint (the case of a @i<null
+condition that is called a @i<constraint> (the case of a @i<null
constraint> that specifies no restriction is also included); the rules for
which values satisfy a given kind of constraint are given in 3.5 for
@fa<range_constraint>s, 3.6.1 for @fa<index_constraint>s, and 3.7.1 for
@fa<discriminant_constraint>s.
@dby
The set of possible values for an object of a given type can be subjected to a
-condition that is called a constraint (the case of a @i<null
+condition that is called a @i<constraint> (the case of a @i<null
constraint> that specifies no restriction is also included); the rules for
which values satisfy a given kind of constraint are given in 3.5 for
@fa<range_constraint>s, 3.6.1 for @fa<index_constraint>s, and 3.7.1 for
@fa<discriminant_constraint>s. The set of possible values for an object of an
-access type can also be subjected to a condition that is called a null
-exclusion (see 3.10).
+access type can also be subjected to a condition that excludes the null
+value (see 3.10).
!corrigendum 3.2(8)
@@ -429,8 +443,8 @@
constraint @i<of> the subtype. The set of values
of a subtype consists of the values of its type
that satisfy its constraint and, in the case
-of a subtype of an access type, any applicable null exclusion.
-Such values @i<belong> to the subtype.
+of a subtype that excludes null, the values do not
+include the null value. Such values @i<belong> to the subtype.
!corrigendum 3.2.2(3)
@@ -439,6 +453,20 @@
@dby
@xcode<@fa<subtype_indication ::= [null_exclusion] subtype_mark [constraint]>>
+!corrigendum 3.4(6)
+
+@dinsa
+The first subtype of the derived type is unconstrained if a
+@fa<known_discriminant_part> is provided in the declaration of the derived type, or
+if the parent subtype is unconstrained. Otherwise,
+the constraint of the first subtype @i<corresponds> to that of the parent
+subtype in the following sense: it is the same as that of the parent subtype
+except that for a range constraint (implicit or explicit), the value of each
+bound of its range is replaced by the corresponding value of the derived type.
+@dinst
+The first subtype of the derived type excludes null (see 3.10) if and
+only if the parent subtype excludes null.
+
!corrigendum 3.7(5)
@drepl
@@ -501,10 +529,7 @@
@fa<subtype_mark> denotes its @i<designated subtype>. If the
@fa<general_access_modifier>
@b<constant> appears, the type is an access-to-constant type; otherwise it is
-an access-to-variable type. If a @fa<null_exclusion> is present, or the
-@fa<access_definition> is for a controlling access parameter (see 3.9.2), the
-@fa<access_definition> defines an access subtype which excludes the null value;
-otherwise the subtype includes a null value.
+an access-to-variable type.
!corrigendum 3.10(13)
@@ -526,26 +551,35 @@
case of an access-to-object type, an @fa<allocator>, which returns an
access value designating a newly created object (see 3.10.2).
+A @fa<null_exclusion> in an @fa<access_definition>, @fa<access_type_definition>,
+@fa<subtype_indication> (see 3.2.2), @fa<discriminant_specification> (see 3.7),
+@fa<parameter_specification> (see 6.1),
+@fa<parameter_and_result_profile> (see 6.1), @fa<object_renaming_declaration>
+(see 8.5.1), or @fa<formal_object_declaration> (see 12.4) specifies that the
+null value does not belong to the access subtype defined by the construct, that
+is, the access subtype @i<excludes null>. In addition, the anonymous access
+subtype defined by the @fa<access_definition> for a controlling access
+parameter (see 3.9.2) excludes null.
+Finally, for a @fa<subtype_indication> without a @fa<null_exclusion>,
+the subtype denoted by the @fa<subtype_indication> excludes null if and
+only if the subtype denoted by the @fa<subtype_mark> in the
+@fa<subtype_indication> does.
+
!corrigendum 3.10(14/1)
-@drepl
+@dinsa
All subtypes of an access-to-subprogram type are constrained. The first subtype
of a type defined by an @fa<access_definition> or an
@fa<access_to_object_definition> is unconstrained if the designated subtype is
an unconstrained array or discriminated subtype; otherwise it is constrained.
-@dby
-All subtypes of an access-to-subprogram type are constrained. The first subtype
-of a type defined by an @fa<access_definition> or an
-@fa<access_to_object_definition> is unconstrained if the designated subtype is
-an unconstrained array or discriminated subtype; otherwise it is constrained.
-The first subtype of a type defined by an @fa<access_type_definition> excludes
-the null value if a @fa<null_exclusion> is present; otherwise, the first
-subtype includes the null value.
-
+@dinst
@i<@s8<Legality Rules>>
-A @fa<null_exclusion> is only allowed in a @fa<subtype_indication> whose
-@fa<subtype_mark> denotes an access subtype that includes a null value.
+A @fa<null_exclusion> is only allowed in a @fa<subtype_indication>,
+@fa<discriminant_specification>, @fa<parameter_specification>,
+@fa<parameter_and_result_profile>, @fa<object_renaming_declaration>, or
+@fa<formal_object_declaration> whose @fa<subtype_mark>
+denotes an access subtype that does not exclude null.
!corrigendum 3.10(15)
@@ -558,11 +592,11 @@
@dby
A @fa<composite_constraint> is @i<compatible> with an unconstrained access
subtype if it is compatible with the designated subtype. A @fa<null_exclusion>
-is compatible with any access subtype that includes a null value. An
+is compatible with any access subtype that does not exclude null. An
access value @i<satisfies> a @fa<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 @fa<null_exclusion>
-imposed on an access subtype if it does not equal the null value of its type.
+satisfies the constraint. An access value satisfies an access subtype that
+excludes null if it does not equal the null value of its type.
!corrigendum 4.2(7)
@@ -575,13 +609,13 @@
@drepl
@xbullet<The tested type is not scalar, and
-the value of the @nt<simple_expression> satisfies any constraints
-of the named subtype, and, if the type of the @nt<simple_expression>
+the value of the @fa<simple_expression> satisfies any constraints
+of the named subtype, and, if the type of the @fa<simple_expression>
is class-wide, the value has a tag that identifies a type covered by
the tested type.>
@dby
@xbullet<The tested type is not scalar, and
-the value of the @nt<simple_expression> satisfies any constraints
+the value of the @fa<simple_expression> satisfies any constraints
of the named subtype, and:>
@xinbull<if the type of the @fa<simple_expression> is class-wide, the
value has a tag that identifies a type covered by the tested type;>
@@ -606,8 +640,8 @@
@dby
After conversion of the value to the target type, if the target subtype is
constrained, a check is performed that the value satisfies this constraint.
-If the target subtype excludes the null value, then a check is made that
-the value is not null.
+If the target subtype excludes null, then a check is
+made that the value is not null.
!corrigendum 4.9.1(2)
@@ -734,8 +768,8 @@
check that the value of the discriminant is not @b<null>.
@dby
When evaluating a dereference (explicit or implicit), check that the value of
-the @fa<name> is not @b<null>. When converting to a null-excluding subtype,
-check that the converted value is not @b<null>.
+the @fa<name> is not @b<null>. When converting to a subtype that excludes
+null, check that the converted value is not @b<null>.
!corrigendum 12.5.1(10)
Questions? Ask the ACAA Technical Agent