CVS difference for ai05s/ai05-0297-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai05s/ai05-0297-1.txt

--- ai05s/ai05-0297-1.txt	2012/03/15 03:21:38	1.2
+++ ai05s/ai05-0297-1.txt	2012/03/20 06:17:05	1.3
@@ -112,7 +112,7 @@
 S'Last_Valid denotes the largest value that belongs to S and
 satisfies any predicate of S. The value of this attribute is of the type of S.>
 
-First_Valid and Last_Valid attribute_references are always static
+First_Valid and Last_Valid @fa<attribute_reference>s are always static
 expressions. Any predicate of S is always a static predicate.
 
 !ACATS Test
@@ -646,6 +646,167 @@
 > that works? :-)
 
 Yes, I see.  We find a bug, and we thereby open Pandora's Box.  ;-)
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Saturday, February 25, 2012  8:21 PM
+
+[He's commenting on version /01 of the AI - Editor.]
+
+Just one question, if we have a subtype with a static range, and a non-static
+predicate, is that now a non-static subtype? I didn't quite see from the below
+description how to know that these attributes do not apply in the case where there
+is a non-static predicate???
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Saturday, February 25, 2012  10:22 PM
+
+> Just one question, if we have a subtype with a static
+> range, and a non-static predicate, is that now a non-static subtype? 
+
+No "now" about it. It's always been the case that a dynamic predicate makes a subtype
+nonstatic (see 4.9(26/3)). The "bug" was that a nonstatic subtype with a static
+predicate was still allowed in loops (and these future attributes).
+ 
+> I didn't quite see from the below description how to
+> know that these attributes do not apply in the case where
+> there is a non-static predicate???
+
+Please note that what Steve sent is an AI12, which contain corrections and extensions
+to Ada *2012*. Essentially, this proposal was rejected for immaturity for Ada 2012
+(to be essentially finalized tomorrow - only two AIs remain tonight), and Steve was
+assigned to write up what we had considered to be reconsidered for some future version
+of Ada. (Which we usually call "Ada 2020").
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Sunday, February 26, 2012  2:16 AM
+
+...
+> No "now" about it. It's always been the case that a dynamic predicate 
+> makes a subtype nonstatic (see 4.9(26/3)). The "bug" was that a 
+> nonstatic subtype with a static predicate was still allowed in loops 
+> (and these future attributes).
+
+OK, thanks for the clarification, that makes sense
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Sunday, February 26, 2012  2:17 AM
+
+...
+>     Please note that what Steve sent is an AI12, which contain
+>     corrections and extensions to Ada *2012*. Essentially, this proposal
+>     was rejected for immaturity for Ada 2012 (to be essentially
+>     finalized tomorrow - only two AIs remain tonight), and Steve was
+>     assigned to write up what we had considered to be reconsidered for
+>     some future version of Ada. (Which we usually call "Ada 2020").
+
+OK, sounds good, new proposal sounds reasonable, and we will go ahead and implement
+these attributes as impl-defined in GNAT.
+
+****************************************************************
+
+From: John Barnes
+Sent: Sunday, February 26, 2012  8:39 AM
+
+So I can use First_Valid and Last_Valid in my example of playing darts.
+
+Excellent
+
+****************************************************************
+
+From: Bob Duff
+Sent: Sunday, February 26, 2012  12:06 PM
+
+> So I can use First_Valid and Last_Valid in my example of playing darts.
+
+This is an Ada 2020 feature, not 2012!
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Sunday, February 26, 2012  12:12 PM
+
+Well that's only a theoretical distinction, since in practice the only Ada 2012
+compiler is GNAT for now (and who knows for how longer, probably a long time),
+and GNAT will implement First_Valid and Last_Valid, the answer is yes, and in
+any case, the answer is yes using the software present tense :-)
+
+****************************************************************
+
+From: Bob Duff
+Sent: Sunday, February 26, 2012  12:24 PM
+
+John is writing a book about Ada 2012, not about GNAT!
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Sunday, February 26, 2012  12:38 PM
+
+Right, but there won't be much distinction between the two for most readers. As i
+say, it is a pity we don't just put these attributes in Ada 2012, it serves no
+purpose to leave them out, except some aesthetic concern about 100% right language
+in the RM :-)
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Sunday, February 26, 2012  12:06 PM
+
+> So I can use First_Valid and Last_Valid in my example of playing darts.
+
+Not yet, it won't be in Ada 2012. So the Rationale better skip it. It seems
+that GNAT will support it.
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Sunday, February 26, 2012  12:13 PM
+
+It seems a shame not to shove it into Ada 2012 when in practice all Ada 2012
+compilers will support it and it seems very straightforward.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Sunday, February 26, 2012  12:29 PM
+
+After further discussion, we changed our collective mind, and just approved
+moving the First_Valid/Last_Valid attribute into 2012 (in section 3.5.5).
+
+[Note that these messages came in real-time during the ongoing ARG meeting
+#46. The wonders of modern technology - I remember getting ARG meeting notes
+on paper a month after the meeting back in the 1980s. - Editor.]
+
+****************************************************************
+
+From: Robert Dewar
+Sent: Sunday, February 26, 2012  12:40 PM
+
+Gosh, and I thought I would be able to implement it *before* it got into the
+language :-)
+
+BTW, it was a surprise to me that the following is illegal
+
+> procedure ss (rmin : integer) is
+>    subtype r is integer range 1 .. 10;
+>      with Dynamic_Predicate => r >= rmin;
+>    rr : r;
+> begin
+>    case rr is
+>       when 1 .. 10 => null;
+>    end case;
+> end;
+
+GNAT does not catch this case, something to fix, I wonder how many more similar
+surprises there are?
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent