CVS difference for ai22s/ai22-0037-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai22s/ai22-0037-1.txt

--- ai22s/ai22-0037-1.txt	2022/02/04 03:54:53	1.2
+++ ai22s/ai22-0037-1.txt	2022/06/18 05:10:21	1.3
@@ -318,3 +318,80 @@
 Probably we do need a Ramification AI to make these things clear.
 
 ****************************************************************
+
+From: Tucker Taft
+Sent: Friday, January 28, 2022  8:24 AM
+
+AI22-0037-1 concludes that from a freezing point of view, T'Range is *not* 
+equivalent to T'First .. T'Last.  I would have come to the opposite
+conclusion, because of the simple equivalence defined in 3.5(14) between
+them (see below).  On the other hand, T and T'Range are not equivalent as far
+as freezing in my view, whereas it seems AI22-0037-1 presumes they are
+equivalent.
+
+>Doesn't need to be a discussion, as Foo and Foo'Range are equivalent for this
+>purpose.
+>... 
+>4.9(7) says that a static expression is (in part) "an attribute_reference that
+>denotes a scalar value, and whose prefix denotes a static scalar subtype;"
+>Foo'Range does not denote a scalar value (it denotes a scalar range, not the
+>same thing at all), and thus it is not a static expression. Ergo, in a
+>context/place where a static expression freezes but a non-static expression
+>does not (such as a default expression), Foo'range does not freeze while
+>Foo'First .. Foo'Last does.
+
+But there is also an equivalence in 3.5(14) which is as simple as it could be:
+
+S'Range is equivalent to the range S'First .. S'Last.
+
+and I would normally interpret this as all of the legality, static semantics,
+and dynamic semantics rules that apply to 'First and 'Last, due to this
+equivalence, also apply to 'Range.  Is there some indication in the RM that
+this equivalence does not cover legality and static semantics rules?
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, February 2, 2022  7:43 PM
+
+FYI, Tucker and I have been discussing this case off-line. My main concern is 
+that this equivalence, like almost any other, cannot be perfect (see below)
+and there is no description in the AARM telling what is intended. So it's
+unclear as to whether freezing (and any other Legality Rules that might apply)
+was intended to be included in the equivalence.
+ 
+One thing Tucker and I do agree on is that it is really difficult to write a
+realistic program in which any such difference would matter. (Most example
+programs use a combination of aspect_specifications and late
+attribute_definition_clauses, which is not a likely combination. One also 
+could do it with a late local constant declaration that hides a use-visible
+constant, but that isn't very likely either.) Moreover, T'range for discrete
+T isn't used often anyway, as one can use T by itself in all of the same 
+contexts. So this becomes rare**2, and thus isn't very interesting to decide.
+ 
+The reason that I believe the equivalence cannot be exact is that two 
+expressions using T'range and T'First..T'Last cannot conform given the current
+wording. Conformance uses a syntax equivalence check, and that is not met for
+the above supposedly equivalent expressions. Moreover, the array case of
+T'range uses the same equivalence wording with a dynamic semantics exception;
+because of the dynamic semantics exception, it would defeat the purpose of
+full conformance if an array Obj'range conformed with Obj'First .. Obj'Last
+(since the number of times that Obj is evaluated is different for the two
+expressions; expressions that conform are supposed to be semantically
+identical). Since the conformance wording and the equivalence wording both
+are the same for both discrete and array 'Range, one cannot get different
+answers for the two cases (one would have to have some wording about Legality
+differences somewhere for that to happen). Ergo, there cannot be an exact
+equivalence for Legality Rules for T'range, and we then don't have a way to
+figure out what the real boundary is (and which side of the boundary that we
+find freezing).
+ 
+Since, as noted above, this is very unimportant, it isn't worth spending more
+energy trying to tighten up the hole, and especially not ARG energy. So,
+Tucker and I will need to hash out AI !discussion text that is acceptable to
+both of us; but whatever we come up with will not change the basic conclusion
+of the AI (which is the difference between T and T'First .. T'Last vis-a-vis
+freezing for a static discrete T). We can certainly discuss and possibly
+approve this AI if it comes up on the agenda tomorrow.
+
+****************************************************************

Questions? Ask the ACAA Technical Agent