58 van Wijngaarden, et al.where (ROWS) is (row ROWSI),strong ROWSI of MODE NEST joined portrait{b} PACK ;EMPTY PACK.e) strong structured withFIELDS FIELD mode NEST collateral clause{5D,551a} :NEST FIELDS FIELD portrait{f} PACK.f) NEST FIELDS FIELD portrait{e,f} :NEST FIELDS portrait{f ,g}, and also{94f} token,NEST FIELD portrait{g}.{FIELD :: MODE field TAG.}g) NEST MODE field TAG portrait{f} : strong MODE NEST unit{32d}.h) *structure display : strong structured withFIELDS FIELD mode NEST collateral clause{e}.i) * row display : strong ROWS of MODE NEST collateral clause{d}.j) * display : strong STOWED NEST collateral clause{d,e}.k) *vacuum : EMPTY PACK.{Examples:a) (x:=l,y:=2) b) x:=l,y:=2c) par (task1, task2) d) (1, 2) (in [ ] real (1, 2))e) (1, 2) (in compl (1, 2)) f) 1, 2g) 1}{Structure-displays must contain at least two FIELD-portraits, for,otherwise, in the reach ofmode m = struct (ref m m); m nobuo, yoneda;,the assignation nobuo := (yoneda) would be syntactically ambiguous andcould produce different effects; however, m of nobuo := yoneda isunambiguous.Row-displays contain zero, two or more constituent units. It is alsopossible to present a single value as a multiple value, e.g., [1: 1] int v :=123, but this uses a coercion known as rowing (6.6).}3.3.2. Semanticsa) The elaboration of a void-collateral-clause or void-parallel-clauseconsists of the collateral elaboration of its constituent units and yieldsempty.b) The yield W of a STOWED.collateral-clause C is determined asfollows:If the direct descendent of C is a vacuum,then {'STOWED' is some "ROWS of MODE' and} each bound pair in thedescriptor of W is (1, 0) {and it has one ghost element whose value isirrelevant};otherwise,• let V 1 .... V be the {collateral} yields of the constituent units of C;' mALGOL <strong>68</strong> Revised ReportCase A: 'STOWED' is some "structured with FIELDS mode':• the fields of W, taken in order, are V 1 ..... Vm;Case B: 'STOWED' is some 'row of MODEl':• W is composed of(i) a descriptor ((1,m)),(ii) V 1 ..... Vm;For i = 1, ... , m,• the element selected by the index (i) in W is Vi;Case C: 'STOWED' is some 'row ROWS of MODE2":• it is required that the descriptors of V 1 ..... V be identical;rn• let the descriptor of {say} V 1 be (01, Ul) ..... (In, Un)) ;• W is composed of(i) a descriptor ((1, m), (11, Ul) ..... (in, Un)) ;(ii) the elements of V 1 ..... Vm;For i = 1 ..... m,• the element selected by an index (i, i I ..... i n) in W is thatselected by 01 ..... i n) in V..I[Note that in [,, ] char block = Cabc", "def"), the descriptor of the threedimensionalyield W will be ((1, 2), (1, 1), (1, 3)), since the units "abc"and "def" are first rowed (6.6), so that V 1 and V 2 have descriptors ((1, 1),(1, 3)).}3.4. Choice clauses{Choice-clauses enable a dynamic choice to be made among differentpaths in a computation. The choice among the alternatives (the in.CHOICE.and the out-CHOICE-clause) is determined by the success or failure of atest on a truth value, on an integer or on a mode. The value under test iscomputed by an enquiry-clause before the choice is made.A choice-using-boolean-clause (or conditional.clause) is of the form(x> 0J xJ 0) in the "brief" style, orif x > 0 then x else 0 fl in the "bold" style;x > 0 is the enquiry-clause, then x is the in-CHOICE-clause and else 0 is theout-CHOICE-clause; all three may have the syntactical structure of aseries, because all choice-clauses are well closed. A choice-using-boolean.clause may also be reduced to(x< O[x:=-x) orif x < 0 then x := -x fl;the omitted out-CHOICE-clause is then understood to be an elseskip. On theother hand, the choice can be reiterated by writing(x>O[ l+x[: x< O[ 1 -xl 1) orif x > 0 then i + x elif x < 0 then i - x else 1 fl,59
60 van Wijngaarden, et al.and so on; this is to be understood as(x >O[ l + x[ (x < OI 1 -x I i)).CASE-clauses, which define choices depending on an integer or on amode, are different in that the in-CASE-clause is further decomposed intounits. The general pattern is(---{---, .... ---I---) orcase --- in ---, ..., --- out --- esac.The choice may also be reiterated by use of ouse.In a choice-using-integral-clause (or ease-clause), the parts are simplyunits and there must be at least two of them; the choice among the unitsfollows their textual ordering.Example:proc void work, relax, enjoy;case int day; read (day); dayin work, work, work, work, work, relax, enjoyout print ((day, "is not in the week"))esac.In a choice-using-UNITED-clause (or conformity-clause), which testsmodes, each case-part-of-CHOICE is of the form (declarer identifier): unitor (declarer): unit. The mode specified by the declarer is compared withthe mode of the value under test; the identifier, if present, is availableinside the unit to access that value, with the full security of syntacticalmode checking. The 'UNITED' mode provides the required freedom for themode of the value under test; moreover, that 'UNITED' mode must containthe mode of each specification for, otherwise, the corresponding case-partof-CHOICEcould never be chosen.Example:'mode boy = struct (int age, real weight),• mode girl = struct (int age, real beauty);proc union (boy, girl) newborn;case newborn in(boy john): print (weight of john),(girl mary): print (beauty of mary)esac. }{The flowers that bloom in the spring,Tra la,Have nothing to do with the case.Mikado,W.S. Gilbert.}{The hierarchy of ranges in conditional-clauses is illustrated byifthen else JI I . I IALGOL <strong>68</strong> Revised Report 61and similarly for the other kinds of choice. Thus the nest and the environof the enquiry-clause remain valid over the in-CHOICE-clause and the out-CHOICE-clause. However, no transfer back from the in- or out-CHOICEclauseinto the enquiry-clause is possible, since the latter can contain nolabel-definitions (except within a closed-clause contained within it).}3.4.1. SyntaxA) CHOICE :: choice using boolean ; CASE.B) CASE :: choice using integral ; choice using UNITED.a) SOlD NESTI CHOICE elause{5D,551a,A341h,A349a} :CHOICE STYLE start{91a,-},SOlD NESTI chooser CHOICE STYLE clause{b},CHOICE STYLE finish{91e,-}.b) SOlD NESTI chooser choice using MODE STYLE clause{a,l} :MODE NESTI enquiry clause defining LAYER2{c,-},SOlD NESTI LAYER2 alternate choice using MODESTYLE clause{d}.c) MODE NESTI enquiry clause defining new DECSETY2{b,35g} :meek MODE NESTI new DECSETY2 series with DECSETY2{32b}.d) SOlD NEST2 alternate CHOICE STYLE clause{b} :SOlD NEST2 in CHOICE STYLE clause{e} ;where SOlD balances SOIDI and SOID2{32e},SOIDI NEST2 in CHOICE STYLE clause{e},SOLD2 NEST2 out CHOICE STYLE clause{l}.e) SOlD NEST2 in CHOICE STYLE clause{d} :CHOICE STYLE in[91b,-}, SOlD NEST2 in part of CHOICE{f,g,h}.f) SOlD NEST2 in part of choice using boolean{e} :SOlD NEST2 serial clause defining LAYER3{32a}.g) SOlD NEST2 in part of choice using integral{e} :SOlD NEST2 joined portrait{33b}.h) SOlD NEST2 in part of choice using UNITED{e,h} :SOlD NEST2 case part of choice using UNITED{i} ;where SOlD balances SOIDI and SOlD2{32e},SOIDI NEST2 case part of choice using UNITED{i},and also{94f} token,SOLD2 NEST2 in part of choice using UNITED{h}.i) SOlD NEST2 case part of choice using UNITED{h} :MOlD NEST2 LAYER3 specification defining LAYER3[j,k,-},where MOlD unites to UNITED{64b},SOlD NEST2 LAYER3 unit{32d}.{Here LAYER3 :: new MODE TAG ; new EMPTY.}j) MODE NEST3 specification defining new MODE TAG3{i} :NEST3 declarative defining new MODE TAG3{541e} brie[ pack,colon{94f} token.k) MOlD NEST3 specification defining new EMPTY{i} :formal MOll) NEST3 declarer{46b} brief pack, colon{94f} token.
- 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 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