CVS difference for ai12s/ai12-0086-1.txt
--- ai12s/ai12-0086-1.txt 2013/10/31 05:43:22 1.1
+++ ai12s/ai12-0086-1.txt 2015/01/27 00:20:56 1.2
@@ -1,4 +1,4 @@
-!standard 4.3.1(17/3) 13-10-30 AI12-0086-1/01
+!standard 4.3.1(17/3) 15-01-26 AI12-0086-1/02
!standard 4.3.1(19/3)
!class Amendment 13-10-30
!status work item 13-10-30
@@ -58,10 +58,6 @@
!wording
-[Editor's note: This wording was Steve's original wording updated
-with suggestions from Bob and others in e-mail, plus a couple of minor
-issues that I noticed.]
-
Replace 4.3.1(17/3)
The value of a discriminant that governs a variant_part P shall
@@ -70,47 +66,27 @@
governing the variant_part enclosing V.
with
-
- Given a variant part P governed by a discriminant whose type is T, an
- expression of type T is said to *determine a variant* of P if
- either
- * the value of the expression is static; or
- * the expression is the name of an object whose nominal subtype
- is static and constrained, there is at least one value
- belonging to the subtype that satisfies any predicate of the subtype,
- and there exists exactly one discrete_choice_list of P
- that covers every value belonging to that static subtype that satisfies the
- constaints and predicates of that subtype.
-
-[Editor's note: "of" was changed to "belonging to" since that's the defined
-term to describe which values are in a subtype. The middle part is new and
-is intended to require that the subtype has at least one value; the wording
-was lifted from 3.5.5(7.1/3), which makes the same requirement.]
-
- The value of a discriminant that governs a variant_part P shall
- be given by an expression that determines a variant of P, unless
- P is nested within a variant V that is not
- selected by the discriminant value governing the variant_part
- enclosing V.
-Append to the end of 4.3.1(19).
-
- If the value of a discriminant is given by a non-static
- expression that is required by the above rules to determine
- a variant of some variant_part [of the type of the aggregate],
- and the evaluation of that expression yields a value that does not
- belong to the nominal subtype of the expression, then Constraint_Error
- is raised.
+ The value of a discriminant that governs a variant_part P shall be
+ given by a static expression, or by a nonstatic expression having a
+ constrained static nominal subtype, unless P is nested within a
+ variant V that is not selected by the discriminant value governing
+ the variant_part enclosing V. In the case of a nonstatic expression,
+ there shall be exactly one discrete_choice_list of P that covers
+ each value that belongs to the nominal subtype and satisfies the
+ predicates of the subtype, and there shall be at least one such value.
+
+Append to the end of 4.3.1(19):
+
+ If the value of a discriminant that governs a (selected) variant_part
+ P is given by a nonstatic expression, and the evaluation of that
+ expression yields a value that does not belong to the nominal subtype
+ of the expression, then Constraint_Error is raised.
AARM Ramification: In this case, the value of the discriminant is
outside the base range of its type, or is an invalid representation.
- This is the same rule as the similar case for case statements.
+ This is a rule similar to that used for case statements.
-[TBD: instead of the awkward "is required by the above rules" wording, we could
-define yet another term in the 4.3.1(17/3) stuff with something like "Such an
-expression is said to be aggregate governing" or "variant part determining" or
-somesuch and then refer to that new term in the dynamic semantics rule.]
-
!discussion
With these rules, the compiler always knows at compile-time which components
@@ -1885,5 +1861,39 @@
Yeah! I like to say that "others" means ALL the others, including the ones you
might invent next week or next year.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Monday, January 26, 2015 5:38 PM
+
+Here is an attempt to simplify the wording for this AI. [This is version /02 of
+this AI - Editor.] I think this is important functionality, as I have worked on
+several programs that bump into the awkwardness that occurs any time you have a
+variant-part where a given variant has more than one choice in its choice list.
+Trying to create aggregates for these beasts is painful.
+
+I wanted to rewrite this in a way that didn't introduce yet another term.
+Nitpickers might complain about the use of "(selected)" in the run-time check,
+but I think the meaning is pretty clear.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Monday, January 26, 2015 5:43 PM
+
+The following, which appears at the beginning of the wording, is a lie at this
+stage:
+
+[Editor's note: This wording was Steve's original wording updated with
+suggestions from Bob and others in e-mail, plus a couple of minor issues that I
+noticed.]
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Monday, January 26, 2015 5:50 PM
+
+OK, I'll take it out when I file it. [And I did - Editor.]
****************************************************************
Questions? Ask the ACAA Technical Agent