94van Wijngaarden, et al.ALGOL <strong>68</strong> Revised Report 95{Example:a) x (in real (x)) }6.2.2. SemanticsThe yield W of a dereferenced-to-MODE-FORM Ffollows:• let {the name} N be the yield of the MEEK-FORM of F;• it is required that N be not nil;• W is the value referred to by N.6.3. Deproceduringis determined as{Deproceduring is used when a routine without parameters is to becalled. E.g., in x := random, the routine yielded by random is called andthe real number yielded is assigned: the a posteriori mode of random is"real'. Syntactically, an initial "procedure yielding' is removed from the apriori mode.}6.3.1. Syntaxa) deprocedured to{61C,67a} MOID FORM :MEEK{61C} procedure yielding MOID FORM.b) softly deprocedured to{61D} MODE FORM :SOFT{61D} procedure yielding MODE FORM.{Examples:a) random (in real (random))b) xory (in xory:=3.14, see 1.1.2) }6.3.2. SemanticsThe yield W of a deproeedured.to-MOID-FORM or softly-deprocedured-to-MOlD-FORM F, in an environ E, is determined as follows:• let {the routine} R be the yield in E of the direct descendent of F;• W is the yield of the calling {5.4.3.2.b} of R in E;• it is required that W be not newer in scope than E.6.4. Uniting{Uniting does not change the mode of the run-time value yielded by aconstruct, but simply gives more freedom to it. That value must beacceptable to not just that one mode, but rather to the whole of a given setof modes. However, after uniting, that value may be subject to a primitiveaction only after being dynamically tested in a conformity-clause (3.4.1.q);indeed, no primitive action can be programmed with a construct of a"UNITED' mode (except to assign it to a UNITED-variable, of course).Example:union (booL char) t, v;t := "a"; t := true; v := t. }6.4.1. Syntaxa) united to{6tB} UNITED FORM .. MEEK{61C} MOlD FORM,where MOlD unites to UNITED{b}.b) WHETHER MOLD1 unites to MOID2{a,34i,71m} :where MOIDI equivalent MOlD2{73a}, WHETHER false ;unless MOIDI equivalent MOID2{73a},WHETHER safe MOODSI subset of safe MOODS2{731,m,n},where (MOODSI) is (MOIDI)or (union of MOODSI mode) is (MOIDI),where (MOODS2) is (MOLD2)or (union of MOODS2 mode) is (MOLD2).{Examples:a) x (in uir := x) •u (in union (char, int, void)(u), in a reach containingunion (int, void) u : = empty) }6.5. Widening{Widening transforms integers to real numbers, real numbers tocomplex numbers (in both cases, with the same size), a value of mode'BITS' to an unpacked vector of truth values, or a value of mode 'BYTES'to an unpacked vector of characters.For example, in z := 1, the yield of 1 is widened to the real number 1.0and then to the complex number (1.0, 0.0); syntactically, the a priorimode specified by int is changed to that specified by real and then to thatspecified by compl.}6.5.1. SyntaxA) BITS :: structured withrow of boolean field SITHETY letter aleph mode.B) BYTES :: structured withrow of character field SITHETY letter aleph mode.C) SITHETY :: LENGTH LENGTHETY ; SHORTH SHORTHETY ;EMPTY.D) LENGTH :: letter ! letter o letter n letter g.E) SHORTH :: letter s letter h letter o letter r letter t.F) LENGTHETY :: LENGTH LENGTHETY ; EMPTY.G) SHORTHETY :: SHORTH SHORTHETY ; EMPTY.a) widened to{b,61A} SIZETY real FORM :MEEK{6IC} SIZETY integral FORM.{SIZETY :: long LONGSETY ; short SHORTSETY ; EMPTY.}
96 van Wijngaarden, et al.b) widened to{61A} structured with SIZETY real field letter r letter eSIZETY real field letter i letter m mode FORM :MEEK[61C} SIZETY real FORM ;widened to{a} SIZETY real FORM.c) widened to{61A} row of boolean FORM : MEEK{61C} BITS FORM.d) widened to{6IA} row of character FORM : MEEK{61C} BYTES FORM.{Examples:a) I (inx:=l)b) 1.0 (in z:= 1.0) • 1 (in z:= 1)c) 2r101 (in [ ] bool(2rl01))d) r (in [ }char(r), see 1.1.2)}6.5.2. SemanticsThe yield W of a widened-to-MODE-FORM F is determined as follows:• let V be the yield of the direct descendent of F;Case A: 'MODE' is some "SIZETY real':• W is the real number widenable from {2.1.3.1.e} V;Case B: 'MODE' is some 'structured with SIZETY real letter r letter eSiZETY real letter i letter m mode':• W is {the complex number which is} a structured value whose fieldsare respectively V and the real number 0 of the same size {2.1.3.1.b} asV;Case C: 'MODE' is "row of boolean' or 'row of character':• W is the {only} field of V.6.6. Rowing{Rowing permits the building of a multiple value from a single element.If the latter is a name then the result of rowing may also be a namereferring to that multiple value.Example:[1 : 1] real bl := 4.13 }6.6.1. Syntaxa) rowed to[61A} REFETY ROWSI of MODE FORM :where (ROWSI) is (row),STRONG{61A} REFLEXETY MODE FORM,where (REFETY) is derived from (REFLEXETY){531b,c,-} ;where (ROWS1) is (row ROWS2),STRONG{61A} REFLEXETY ROWS2 of MODE FORM,where (REFETY) is derived from (REFLEXETY){531b,c,-}.{Examples:a) 4.13 (in [1 : I] realbl :=4.13) •xl (in [1: I~1: n]realb2:=xl)}6.6.2. SemanticsALGOL <strong>68</strong> Revised Report 97a) The yield W of a rowed-to-REFETY-ROWSI-of.MODE.FORMdetermined as follows:• let V be the yield of the STRONG-FORM of F;Case A: 'REFETY' is "EMPTY':• W is the multiple value "built" {b} from V for 'ROWSI';Case B: 'REFETY' is 'REF to':If V is nil,then W is a nil name;otherwise, W is the name "built" {c} from V for 'ROWSI'.F isb) The multiple value W "built" from a value V, for some 'ROWSI'; isdetermined as follows:Case A: 'ROWSI' is "row':• W is composed of(i) a descriptor ((1, 1)),(ii) {one element} V;Case B: "ROWSI" is some 'row ROWS2":• let the descriptor of V be ((I 1, Ul) ..... (In, Un));• W is composed of(i) a descriptor ((1, 1), (I 1, Ul) .....(In, Un)),(ii) the elements of V;• the element selected by an index 01 ..... i n) in V is that selected by(1, i 1 ..... i n) in W.c) The name N1 "built" from a name N, for some 'ROWSI', isdetermined as follows:• N1 is a name [not necessarily newly created}, equal in scope to N andreferring to the multiple value built {b}, for 'ROWSI', from the valuereferred to by N;Case A: "ROWSI' is "row':• the {only} subname of N1 is N;Case B: "ROWSI' is some 'row ROWS2":• the subname of N1 selected by (1, i I ..... i n ) is the subname of Nselected by (i 1 ..... in).6.7. Voiding[Voiding is used to discard the yield of some unit whose Primarypurpose is to cause its side-effects; the a posteriori mode is then simply"void'. For example, in x := 1; y := 1;, the assignation y := 1 is voided, andin proct= int: ontlar(randomxlO0); t;, the applied-identifier t is voidedafter a deproceduring, which prescribes the calling of a routine.
- 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 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 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