J3/09-243 To: J3 From: Van Snyder Subject: More on branching and transfer of control Date: 2009 June 30 References: 09-007r2, 09-224r3, 09-176r1, 09-109, 08-206, 09-239, 09-242 1. Introduction Paper 09-176r1 advocated comprehensive and systematic restructuring of execution sequence, procedure invocation and return, constructs, and branching. Some of those reforms were adopted in 09-224r3, but the editor rejected that paper, with reasons stated in 09-239. Several problems remain. This paper addresses a niggling few problems having to do with branching and incorrect use of the term "transfer of control". 2. Edits w.r.t. 09-007r2 [5:1+ 1.3.17+] --------------------------------------------------------- Editor: Insert a subclause: "1.3.17a branch change the normal execution sequence (8.2)" Index this occurrence of "branch". [13:33+ 1.3.93+] ------------------------------------------------------- "Normal execution sequence" needs to be defined. Editor: Insert a subclause: "1.3.93a Normal execution sequence of executable constructs, the order in which they appear within a scoping unit(2.3.5)" This edit also appears in 09-242.txt [18:35+ 1.3.133+] ------------------------------------------------------ The term "transfer of control" needs to be defined. Editor: Insert a subclause: "1.3.133a <> event that causes execution of a statement other than the next one in the normal execution sequence" This edit also appears in 09-242.txt [54:17+8 4.4.2.3: NOTE 4.8] -------------------------------------------- Editor: Replace "transfer of control" by "branch (8.2)". [169:20-21 8.1.2.1p1] -------------------------------------------------- Editor: Replace "Transfer of control" by "Branching" because "transfer of control" prohibits procedures from returning. 8.2.1 says "procedure references... cause transfer of control... [but] they are not branches." Alternative returns are branches, so "Branching" covers that case correctly. Editor: Insert "of control" after "transfers" twice, to make them accurate. The term "transfers" is correct" because it needs to cover both branching and control constructs, which 8.2.1 explicitly says "are not branches." [169:22 8.1.2.1p2] ----------------------------------------------------- Editor: Delete 8.1.2.1p2 because it just restates syntax, is repetitive of 2.3.5, and contradicting 8.1.2.1p1 is not necessary now that it has been corrected. [174:40-42 8.1.6.4p1] -------------------------------------------------- Editor: Replace the paragraph by "The <> of a block DO construct is the ." The remainder of the paragraph is repetitive of 8.1.2.1p1. At least replace "transfer of control" by "branching" because "transfer of control" prohibits procedures from returning, and maybe index this occurrence of branch. [175:4 8.1.6.4p2] ------------------------------------------------------ Editor: Replace "transfer of control" by "branching" because "transfer of control" prohibits procedures from returning. Maybe index this occurrence of "branch". [175:13 8.1.6.6.1p1] --------------------------------------------------- Editor: After "DO statement" insert "other than a DO CONCURRENT statement" or "that is not a DO CONCURRENT statement" because the following steps that are claimed to be performed in sequence are not correct in the DO CONCURRENT case. [176:27-30 8.1.6.6.3p5]------------------------------------------------- Editor: Replace the first "transfer of control" by "branch" the second by "branching" or "a branch", and the third by "branch". These instances of "transfer of control" are not technically incorrect, and the editor argued in 09-239 that they are easier to understand than "branching". [186:6 8.2.2p1] -------------------------------------------------------- Editor: Simplify the description by replacing "is used ... causes" by "alters the normal execution sequence by causing". [186:8 8.2.2p1] -------------------------------------------------------- Editor: After "arithmetic IF statement" insert ", a CYCLE statement, an EXIT statement" to make C811 work. [186:19-20 8.2.2p1] ---------------------------------------------------- Editor: Replace the paragraph by: "Execution of a <> causes a branch to the branch target statement identified by the label." {8.2.1 says a GO TO statement causes a branch, so use the definitions of "branch" and "branch target statement" in 8.2.1.} [186:26 8.2.3p1] ------------------------------------------------------- Editor: Replace "a transfer of control ... is the one" by "a branch occurs to the branch target statement" {8.2.1 says a computed GO TO statement causes a branch, so use the definitions of "branch" and "branch target statement" in 8.2.1.} [186:34-35 8.2.4p1] ---------------------------------------------------- Editor: Replace "transfer of control" by "branch". Insert "is the one" before "identified". Replace "is executed next" by a comma. The result is "The branch target statement is the one identified by the first label, the second label, or the third label, depending on...." {8.2.1 says an arithmetic IF statement causes a branch, so use the definitions of "branch" and "branch target statement" in 8.2.1. We don't need "is executed next" because that's part of the definition of "branch".} [312:1-2 12.6.2.7p1] --------------------------------------------------- Editor: Replace "transfers control to the" by "branches (8.2) to the branch target". Replace "transfer of control" by "branch". Index these appearances of "branch". {8.2.1 says an alternate return causes a branch, so use the definitions of "branch" and "branch target statement" in 8.2.1. This further prohibits arriving inside of a block outwith from it by using an alternate return.} [604] ------------------------------------------------------------------ Editor: Replace the index items "transfer of control" on pp 241-242 by "branch" because they actually use the term "branch".