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

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

--- ai05s/ai05-0179-1.txt	2009/11/04 06:28:31	1.2
+++ ai05s/ai05-0179-1.txt	2010/01/30 05:56:31	1.3
@@ -1,4 +1,4 @@
-!standard 5.1(2)                                  09-10-29  AI05-0179-1/01
+!standard 5.1(2)                                  10-01-29  AI05-0179-1/02
 !class Amendment 09-10-29
 !status work item 09-10-29
 !status received 09-10-29
@@ -30,11 +30,12 @@
 But we need the "null;" since a label is not allowed at the end of a
 sequence_of_statements.
 
-Labels don't have anything in particular to do with statements, they
-just mark a place in the program text. So the requirement to add the
-"null;" adds no benefit at all; it should be eliminated (especially
-as a large percentage of uses of labels are currently saddled with
-this noise).
+Intuitively, a label marks a "place" in a sequence of statements; it doesn't
+mark a particular statement. When you "goto" to a label, you start executing
+at that place and continue on with all the rest of the statements. Therefore,
+it makes perfect sense to have a label after the last statement in a sequence;
+the "null;" adds no benefit at all; it should be eliminated (especially as
+a large percentage of uses of labels are currently saddled with this noise).
 
 !proposal
 
@@ -46,13 +47,23 @@
 
 sequence_of_statements ::= statement {statement} {label}
 
-[Editor's note: It might be better to move all of the {label}s here.]
+Add after 5.1(12): (Static semantics)
 
+If one or more labels end a sequence_of_statements, an implicit null_statement
+follows the labels before any following constructs.
+
 !discussion
 
 It is odd indeed that a label can *start* a sequence of statements, but
 it cannot *end* a sequence of statements. There is no practical difference
 in readability.
+
+We define such a label as being followed by an implicit null_statement so
+that the formal semantics of a goto_statement is preserved (which transfers
+control to a statement, not to the label itself). Changing that semantics
+to something more consistent with the intuitive model mentioned in the
+!problem was considered, but seemed to have much more wording change than
+required for such a simple change to the language.
 
 We retain the requirement that a sequence of statements include at least
 one statement (a label all by itself is still not allowed). So

Questions? Ask the ACAA Technical Agent