CVS difference for ai05s/ai05-0153-3.txt
--- ai05s/ai05-0153-3.txt 2011/03/10 04:49:49 1.12
+++ ai05s/ai05-0153-3.txt 2011/03/17 06:13:16 1.13
@@ -1,4 +1,4 @@
-!standard 3.2.4(0) 11-03-04 AI05-0153-3/06
+!standard 3.2.4(0) 11-03-16 AI05-0153-3/07
!class Amendment 09-05-27
!status Amendment 2012 11-03-04
!status ARG Approved 7-0-1 10-02-18
@@ -191,7 +191,7 @@
subtype to which predicate clauses apply.
The prefix of an attribute_reference whose attribute_designator is First, Last,
-or Range shall not denote a subtype to which predicate clauses apply.
+or Range shall not denote a scalar subtype to which predicate clauses apply.
The discrete_subtype_definition of a loop_parameter_specification shall not
denote a subtype to which Dynamic_Predicate clauses apply.
@@ -225,9 +225,10 @@
12.3), this rule applies also in the private part of an instance of a generic
unit.
-AARM Note: This is usual way around the contract model. The "In addition..."
-wording is included for consistency with similar rules, even though it's
-not really necessary, since Program_Error will be raised anyway.
+AARM Note: This is the usual way around the contract model; this applies even
+in generic bodies. The "In addition..." wording is included for consistency
+with similar rules, even though it's not really necessary, since Program_Error
+will be raised anyway.
NOTE: A predicate clause does not cause a subtype to be considered
"constrained".
@@ -2702,3 +2703,43 @@
****************************************************************
+From: Edmond Schonberg
+Sent: Wednesday, March 16, 2011 7:54 AM
+
+An enthusiastic user has detected a problem with a proposed legality rule
+in the new section 3.2.4 :
+
+The prefix of an attribute_reference whose attribute_designator is First, Last,
+or Range shall not denote a subtype to which predicate clauses apply.
+
+
+We know the motivation for this rule (problem with enumerations with holes, etc.)
+but the rule only makes sense for scalar types. Otherwise
+it is hard to write useful predicates on array subtypes, for example:
+
+package Pred is
+ type A is array (Integer range <>) of Integer
+ with Predicate => (for all J in A'Range =>
+ (for all K in A'Range =>
+ (if J /= K then A (J) /= A (K))));
+end Pred;
+
+The rule should say "scalar subtype".
+
+****************************************************************
+
+From: Bob Duff
+Sent: Wednesday, March 16, 2011 8:08 AM
+
+Please make the following editorial change to AI05-0153-3, Subtype
+predicates:
+
+The prefix of an attribute_reference whose attribute_designator is First, Last,
+or Range shall not denote a {scalar} subtype to which predicate clauses apply.
+
+I think we all meant "scalar" here. Nothing wrong with doing 'Range an a
+predicated array type.
+
+Thanks.
+
+****************************************************************
Questions? Ask the ACAA Technical Agent