54 van Wijngaarden, et al.3.1.1. SyntaxA) SOlD :: SORT MOLD.B) PACK :: STYLE pack.a) SOlD NEST closed clause{22a,5D,551a,A341h,A349a} :SOlD NEST serial clause defining LAYER{32a} I'ACK.{LAYER :: new DECSET~ ' I.ABSETY.}{Example:a) beginx:=l; y:=2end }c)d)ALGOL <strong>68</strong> Revised Report 55where (PROPSETY) is (LAB LABSETY)and SOlD balances SOIDl and SOID2{e}, SOIDI NEST unit{d},completion{94f} token, NEST label definition of LAB{c},SOLD2 NEST series with LABSETY{b} ;where (PROPSETY) is (EMPTY),SOlD NEST unit{d}.NEST label definition of label TAG{b} :label NEST defining identifier with TAG{48a}, label{94f} token.SOME unit{b,33b,g,34i,35d,46m,n,52 lc,532e,541a,b,543c,A34Ab,c,d} : SOME UNIT{5A,-}.{The yield of a closed-clause is that of its constituent serial-clause, byway of pre-elaboration (2.1.4.1.c).}3.2. Serial clauses{The purposes of serial-clauses are• the construction of new ranges of definitions, and• the serial composition of actions.A serial.clause consists of a possibly empty sequence of unlabelledphrases, the last of which, if any, is a declaration, followed by a sequenceof possibly labelled units. The phrases and the units are separated by goon.tokens,viz., semicolons. Some of the units may instead be separated byeompleters, viz., exits; after a completer, the next unit must be labelled sothat it can be reached. The value of the final unit, or of a unit precedingan exit, determines the value of the serial-clause.For example, the following serial-clause yields true if and only if thevector a contains the integer 8:int n; read (n);[I : n] int a; read (a);for i to n do if a [i] = 8 then goto success fl od;3.2.1.a)b)false exitsuccess: true .}SyntaxSOlD NEST serial clause defining new PROPSETY{31a,34f,I,35h} :SOlD NEST new PROPSETY series with PROPSETY{b}.{Here PROPSETY :: DECSETY LABSETY.}SOlD NEST series with PROPSETY{a,b,34c} :strong void NEST unit{d}, go on{94f} token,SOlD NEST series with PROPSETY{b} ;where (PROPSETY) is (DECS DECSETY LABSETY),NEST declaration of DECS{41a}, go on{94f} token,SOlD NEST series with DECSETY LABSETY{b} ;where (PROPSETY) is (LAB LABSETY),NEST label definition of LAB{c},SOlD NEST series with LABSETY{b} ;e)f)g)h)i){Examples:WHETHER SORT MOlD balancesSORTI MOLD1 and SORT2 MOlD2{b,33b,34d,h} :WHETHER SORT balances SORTI and SORT2{f}and MOlD balances MOIDI and MOID2{g}.WHETHER SORT balances SORTI and SORT2{e,522a} :where (SORTI) is (strong), WHETHER (SORT2) is (SORT) ;where (SORT2) is (strong), WHETHER (SORTI) is (SORT).WHETHER MOlD balances MOIDI and MOID2{e} :where (MOIDI) is (MOLD2), WHETHER (MOLD) is (MOIDI) ;where (MOIDI) is (transient MOLD2),WHETHER (MOLD) is (MOIDI) ;where (MOLD2) is (transient MOIDI),WHETHER (MOLD) is (MOLD2).* SOlD unitary clause : SOlD NEST unit{d}.* establishing clause :SOlD NEST serial clause defining LAYER{32a} ;MODE NEST enquiry clause defining LAYER{34c}.b) read (xl); real s : = O;sum:fori ton do(x1 [i] >0[ s +:=xl [i]1 nonpos)odexltnonpos: print (s) •real s : = O;sum: for i to n do (xl [i] > 01 s +: = xl [i] t nonpos) od exitnonpos: print (s) •sum: for i ton do(x1 [i] >0i s + : = x l [ i ] l nonpos) od exitnonpos: print (s) •for i ton do(x1 [i] >0 i s + : = xl [ i ] l nonpos) od exitnonpos: print (s) •print (s)c) sum: d) print (s) }{Often, a series must be "balanced" (3.2.1.e). For remarks concerningbalancing, see 3.4.1.}
56 van Wijngaarden, et al.3.2.2. Semanticsa) The yield of a serial-clause, in an environ E, is the yield of theelaboration of its series, or of any series elaborated "in its place" {5.4.4.2},in the environ "established" {b} around E according to that serial-clause; itis required that the yield be not newer in scope than E.b) The environ E "established"• upon an environ El, possibly not specified, {which determines itsscope,}• around an environ E2 {which determines its composition},• according to a NOTlON-defining-new-PROPSETY C, possibly absent,{which prescribes its locale,}• with values Y 1 ..... Y n, possibly absent, {which are possibly to beascribed,}is determined as follows:• if E1 is not specified, then let E1 be E2:• E is newer in scope than E1 and is composed of E2 and a new localecorresponding to 'PROPSETY', if C is present, and to 'EMPTY' otherwise;Case A: C is an establishing-clause:For each constituent mode-definition hi, if any, of C,• the scene composed of(i) the actual-declarer of M, and(ii) the environ necessary for {7.2.2.c} that actual-declarer in E,is ascribed in E to the mode-indication of M:For each constituent label.definition L, if any, of C,• the scene composed of(i) the series of which L is a direct descendent, and(ii) the environ E,is ascribed in E to the label-identifier of L:If each 'PROP' enveloped by 'PROPSETY' is some "DYADIC TAD" or'label TAG',then E is said to be "nonlocal" {see 5.2.3.2.b};Case B: G is a declarative, a for-part or a specification:For i= 1 ..... n, where n is the number of 'DEC's enveloped by'PROPSETY',• Y. is ascribed {4.8.2.a} in E to the i-th constituent defining-Iidentifier, if any, of G and, otherwise {in the case of an invisible forpart},to an integral-defining-indicator.with-letter-aleph;If C is a for-part or a specification,then E is nonlocal.{Other cases, i.e., when C is absent:• E is local (see 5.2.3.2.b), but not further defined.}c) The yield W of a series C is determined as follows:If C contains a direct descendent unit which is not followed by a go-ontoken,ALGOL <strong>68</strong> Revised Reportthen• W is the yield of that unit;otherwise,• the declaration or the unit, if any, of C is elaborated;• W is the yield of the series of C.{See also 5.4.4.2.Case A.}3.3. Collateral and parallel clauses{Collateral-clauses allow an arbitrary merging of streams of actions.Parallel.clauses provide, moreover, levels of coordination for thesynchronization (10.2.4) of that merging.A collateral- or parallel-clause consists of a sequence of units separatedby and-also-symbols (viz., ","), and is enclosed by parentheses or by abegin-end pair; a parallel-clause begins moreover with par.Collateral-clauses, but not parallel-clauses, may yield stowed valuescomposed from the yields of the constituent units.Examples of collateral.clauses yielding stowed values:[ ] int q = (1, 4, 9, 16, 25);struct (int price, string category) bike := (150, "sport").Example of a parallel-clause which synchronizes eating and speaking:pro¢ void eat, speak; soma mouth = level 1;par begindodown mouth;eat;up mouthod,dodown mouth;speak;up mouthodend .}3.3.1. Syntaxa) strong void NEST collateral clause{5D,551a} :strong void NEST joined portrait{b} PACK.b) SOlD NEST joined portrait{a,b,c,d,34g} :where SOlD balances SOIDI and SOlD2{32e},SOIDI NEST unit{32d}, and also{94f} token,SOLD2 NEST unit{32d}or alternatively SOLD2 NEST joined portrait{b}.c) strong void NEST parallel clause{5D,551a} :parallel{94f} token, strong void NEST joined portrait{b} PACK.d) strong ROWS of MODE NEST collateral clause{5D,551a} :where (ROWS) is (row),strong MODE NEST joined portrait{b} PACK ;57
- 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 30 and 31: 58 van Wijngaarden, et al.where (RO
- Page 32 and 33: 62 van Wijngaarden, et al.1) SOlD N
- 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