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

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

--- ai05s/ai05-0100-1.txt	2008/05/29 03:04:42	1.1
+++ ai05s/ai05-0100-1.txt	2008/10/24 00:37:08	1.2
@@ -1,4 +1,4 @@
-!standard  2.8(6)                                  08-05-28  AI05-0100-1/01
+!standard  2.8(6)                                  08-10-23  AI05-0100-1/02
 !standard  2.8(7)
 !class binding interpretation 08-05-28
 !status work item 08-05-28
@@ -10,6 +10,7 @@
+Pragmas are allowed as the only item in a list if that list is allowed to be empty.
@@ -63,31 +64,47 @@
-Replace 2.8(7) by:
+Add to 2.8:
-* At a place where a pragma would have been allowed by the preceeding rule
-if some legal syntactic item had been given before the pragma, but not
-if the pragma is the only item in a list that requires at least one item.
-AARM Note: "Item" in this context means something like a statement or
-declaration. The last part of the rule just means that a pragma
-cannot replace some item that is required by the syntax (like a statement).
+  AARM NOTE: Language Design Principle
+    In general, if all pragmas are erased from a program, the program should
+    remain both syntactically and semantically legal. There are a few exceptions
+    to this general principle (e.g. pragma Import can eliminate the need for
+    a completion), but the principle remains, and is strictly true at the
+    syntactic level. Certainly any implementation-defined pragmas should
+    obey this principle both syntactically and semantically, so that if
+    the pragmas are simply ignored by some other implementation, the program
+    will remain legal.
+Revise 2.8(5-7) as follows:
+  Pragmas are only allowed at the following places in a program: 
+    * After a semicolon delimiter, but not within a formal_part or
+      discriminant_part.  
+    * At any place where the syntax rules allow a construct defined by
+      a syntactic category whose name ends with "declaration", {"item",}
+      "statement", "clause", or "alternative", or one of the syntactic
+      categories variant or exception_handler; but not in place of
+      such a construct {if the construct is required, or is
+      part of a list that is required to have at least one such 
+      construct [Redundant:, as in a sequence_of_statements]}. 
+      Also at any place where a compilation_unit would be allowed.
-Tucker suggested the principle that after erasing the pragmas, the program
-should still be syntactically legal. That seems like a good principle to
-follow. Another important principle would be that changing the Ada syntax
-should not change where pragmas are allowed.
-However, it will take someone cleverer than I to create wording that will
-meet those goals. "Item" in my attempt above doesn't make much sense.
-The best solution would be to put pragma into the syntax like it should have
-been in the first place, and then adopt an English like the last part of the
-rule above ("A pragma is illegal if it is the only item in a list that
-requires at least one item.") But that would change a lot of the language
+We have added an explicit language design principle to establish the
+general point that if pragmas are erased, the program remains legal
+both syntactically and semantically.  Adding "item" to the list of constructs
+is perhaps not strictly necessary, since generally "item" expands into
+one of the already permitted constructs, but it also does not seem to
+The phrase "but not in place of such a construct" has always caused a bit
+of confusion.  We have qualified the phrase a bit by making it clear it
+applies when the construct is required or is part of a list that must have
+at least one element.  Hopefully this will remove some of the mystery.
 --!corrigendum 2.8(7)

Questions? Ask the ACAA Technical Agent