62 van Wijngaarden, et al.1) SOlD NEST2 out CHOICE STYLE clause{d} :CHOICE STYLE out{91d,-},SOlD NEST2 serial clause defining LAYER3{32a} ;CHOICE STYLE again{gtc,-},SOlD NEST2 chooser CHOICE2 STYLE clause{b},where CHOICE2 may follow CHOICE{m).m) WHETHER choice using MODE2 may follow• choice using MODEl{I} :where (MODEl) is (MOOD), WHETHER (MODE2) is (MODEl) ;where (MODEl) begins with (union of),WHETHER (MODE2) begins with (union of).n) * SOME choice clause : SOME CHOICE clause{a}.o) * SOME conditional clause : SOME choice using boolean clause{a}.p) * SOME case clause : SOME choice using integral clause{a}.q) * SOME conformity clause : SOME choice using UNITED clause{a].{Examples:a) (x>OlxlO).ease i in princeton, grenoble out finish •see •ease uir in anti): print (i), (real): print ("no") •seeb) x>OlxlO c) x>O• i• uird) Ix*lxlOe) Ix*in princeton, grenoble •in (int i): print (i), (reel): print ("no")f) x g) princeton, grenobleh) anti): print (i), (real): print ("no")i) (intO: print(i) j) anti):k) (real):1) out finish • l: x < OI -xl O }{I would to God they would either conform, or be morewise, and not be catched!Diary, 7 Aug. 1664,Samuel Pepys.}{Rule d illustrates why "SORT MOlD's should be "balanced".If analternate-CHOICE-clause is, say, firm, then at least its in-CHOICE-clauseor its out-CHOICE-clause must be firm, while the other may be strong. Forexample, in (p i x I sklp) + (p I sklp l y), the conditional-clause (p i x I sklp)is balanced by making I x firm and J sklp strong whereas (p [ sklp I Y)isbalanced by making i sklp strong and [ y firm. The counterexample(plsklprsklp)+y illustrates that not both may be strong, for otherwise theoperator + could not be identified.}3.4.2. Semanticsa) The yield W of a chooser-CHOICE-clause C, in an environ El, isdetermined as follows:ALGOL <strong>68</strong> Revised Report 63• let E2 be the environ established {3.2.2.b} around E1 according to theenquiry-clause of C;• let V be the yield, in E2, of that enquiry.clause;• W is the yield of the scene "chosen" {b} by V from C in E2; it is requiredthat W be not newer in scope than El.b) The scene S "chosen" by a value V from a MOlD-chooser-CHOICEclauseC, in an environ E2, is determined as follows:Case A: "CHOICE' is "choice using boolean' and V is true:• S is the constituent in-CHOICE-clause of C, in E2;Case B: "CHOICE' is 'choice using integral' and 1
64 van Wijngaarden, et al.value of the control-integer is required. A while-part while true may beomitted. For example,for i from 1 by 1 to n while true do print ("a") odmay be writtento n do print ("a") od.ALGOL <strong>68</strong> Revised Reportd) from-5e) while i < n do task1 od • do task1; task2 odf) while i < n do task1; task2 odg) while i < n h) do task1; task2 od }65The hierarchy of ranges is illustrated by:3.5.1. SyntaxA)_for J-- 7 from2 whileI 3 doFROBYT :: from ; by ; to.a) strong void NESTI loop clause{5D,551a} :NESTI STYLE for part defining new integral TAG2{b},NESTI STYLE intervals{c},NESTI STYLE repeating part with integral TAG2{e}.b) NESTI STYLE for part defining new integral TAG2{a} :STYLE for{94g,-} token,integral NESTI new integral TAG2 defining identifierwith TAG2{48a} ;where (TAG2) is (letter aleph), EMPTY.e) NESTI STYLE intervals{a} : NESTI STYLE from part{d} option,NESTI STYLE by part{d} option,NESTI STYLE to part{d} option.d) NESTI STYLE FROBYT part{c} :STYLE FROBYT{94g,-} token, meek integral NESTI unit{32d}.e) NESTI STYLE repeating part with DEC2{a} :NESTI new DEC2 STYLE while do part{f} ;NESTI new DEC2 STYLE do part{h}.f) NEST2 STYLE while do part{e} :NEST2 STYLE while part defining LAYER3{g},NEST2 LAYER3 STYLE do part{h}.g) NEST2 STYLE while part defining LAYER3{f} :STYLE while{94g,-} token,boolean NEST2 enquiry clause defining LAYER3{34c,-}.h) NEST3 STYLE do part{e,f} :STYLE do{94g,-} token,strong void NEST3 serial clause defining LAYER4{32a},STYLE od{94g,-} token.{Examples:a) fori whilei < n dotaskl od • ton dotaskl; task2odh) for i c) from-5 to +5byto3.5.2. SemanticsA loop-clause C, in an environ El, is elaborated in the following Steps:Step 1: All the constituent FROBYT-parts, if any, of C are elaboratedcollaterally in El;• let f be the yield of the constituent from-part, if any, of C, and be 1otherwise;• let b be the yield of the constituent by-part, if any, of C, and be 1otherwise;• let t be the yield of the constituent to-part, if any, of C, and beabsent otherwise;• let E2 be the environ established {nonlocally (3.2.2.b)} around El,according to the for-part-defining-new-integral-TAG2 of C, and with theinteger f;Step 2: Let i be the integer accessed [2.1.2.c} by 'integral TAG2" inside thelocale of E2;If t is not absent,thenIf b> 0andi >torifb < 0andi < t,then C in E1 {is completed and} yields empty;{otherwise, Step 3 is taken; }Step 3: Let an environ E3 and a truth value w be determined as follows:Case A: C does not contain a constituent while-part:• E3 is E2;• w is true;Case B: C contains a constituent while-part P:• E3 is established {perhaps nonloeally (3.2.2.b)} around E2according to the enquiry-clause of P;• w is the yield in E3 of that enquiry-clause;Step 4: If w is true,then• the constituent do-part of C is elaborated in E3;• 'integral TAG2" is made to access i + b inside the locale of E2;• Step 2 is taken again;otherwise,• C in E1 {is completed and} yields empty.{The loop-clausefor i from ul by u2 to u3 while condition do action odis thus equivalent to the following void-closed.clause:
- Page 2 and 3: van Wijngaarden, et al.1.1.4.2. Par
- Page 4: Acknowledgements{Habent sua fata li
- Page 8 and 9: 14 van Wijngaarden, et al.0.3.4. Mo
- Page 10 and 11: . . . . . . . 4 " ' 0 . . . . . . .
- Page 12 and 13: 22 van Wijngaarden, et al.• let P
- Page 14 and 15: 26 van Wijngaarden, et al.{Since so
- Page 16 and 17: 30 van Wijngaarden, et aLloperandfo
- Page 18 and 19: 34 van Wijngaarden, et al.j) WHETHE
- Page 20 and 21: 38 van Wijngaarden, et al.A protono
- Page 22 and 23: 42 van Wijngaarden, et al.d) If N i
- Page 24 and 25: 46 van Wijngaarden, et al.c) {There
- Page 26 and 27: 50 van Wijngaarden, et al.c) The ph
- Page 28 and 29: 54 van Wijngaarden, et al.3.1.1. Sy
- Page 30 and 31: 58 van Wijngaarden, et al.where (RO
- Page 34 and 35: 66 van Wijngaarden, et al.ALGOL 68
- Page 36 and 37: 70 van Wijngaarden, et el.For each
- Page 38 and 39: 74 van Wijngaarden, et al.If 'MODE"
- Page 40 and 41: 78 J van Wijngaarden, et al.C) SECO
- Page 42 and 43: 82 van Wijngaarden, et al.ALGOL 68
- Page 44 and 45: 86 van Wijngaarden. et al.ALGOL 68
- Page 46 and 47: 90 van Wijngaarden, et al.5.4.4.1.
- Page 48 and 49: 94van Wijngaarden, et al.ALGOL 68 R
- Page 50 and 51: 98 van Wijngaarden, et al.Assignati
- Page 52 and 53: 102 van Wijngaarden, et at.{A nest,
- Page 54 and 55: 106 van Wijngaarden, et al.'HEAD's
- Page 56 and 57: 110 van Wijngaarden, et al.ALGOL 68
- Page 58 and 59: 114van Wijngaarden, et al.ALGOL 68
- Page 60 and 61: 118 van Wijngaarden, et al.ALGOL 68
- Page 62 and 63: 122 van Wijngaarden, et al.style ii
- Page 64 and 65: 126 van Wijngaarden, et al.b) The c
- Page 66 and 67: 130van Wijngaarden, et al.ALGOL 68
- Page 68 and 69: 134van Wijngaarden, et al.ALGOL 68
- Page 70 and 71: 138d)e)f)g)h)i)J)k)1)m)n)van Wijnga
- Page 72 and 73: 142 van Wijngaarden, et al.physics
- Page 74 and 75: 146 van Wijngaarden, et al.gg) On s
- Page 76 and 77: 150van Wijngaarden, et al.ALGOL 68
- Page 78 and 79: 154/van Wijngaarden, et al.ALGOL 68
- Page 80 and 81: 158 van Wijngaarden, et el.fi;ref p
- Page 82 and 83:
162van Wijngaarden, et al.ALGOL 68
- Page 84 and 85:
166van Wijngaarden, et al.ALGOL 68
- Page 86 and 87:
170/van Wijngaarden, etal.ALGOL 68
- Page 88 and 89:
174J)K)L)M)N)O)P)a)b)c)d)e)van Wijn
- Page 90 and 91:
178/van Wijngaarden, et al.ALGOL 68
- Page 92 and 93:
182 van Wijngaarden, et al.• let
- Page 94 and 95:
186van Wijngaarden, et al./ALGOL 68
- Page 96 and 97:
190 van Wijngaarden, etal.composed
- Page 98 and 99:
194h)i)J)van Wijngaa(rden, et al.pr
- Page 100 and 101:
198 van Wijngaarden, et al.¢ strin
- Page 102 and 103:
202tvan Wijngaarden, et al.ALGOL 68
- Page 104 and 105:
206 van Wijngaa~den. et al.10.3.6.1
- Page 106 and 107:
210 van Wijngaarden, et al.!ALGOL 6
- Page 108 and 109:
214 van Wijngaarden, et al.inoperat
- Page 110 and 111:
218fvan Wijngaarden, et al.¢ move
- Page 112 and 113:
222 van Wijngaarden, etaL{overflow}
- Page 114 and 115:
226 van Wijngaarden, et al.ALGOL 68
- Page 116 and 117:
230max int 10.2.1.cmax real 10.2.l.
- Page 118 and 119:
234 van Wijngaarden, et al.ALGOL 68