74 van Wijngaarden, et al.If 'MODE" is some 'STOWED',then• let D1 in E1 be "developed" {c} from D in E;• W is the yield of {the declarator} D1 in an environ established{locally, see 3.2.2.b} upon E and around El;otherwise,• W is any value {acceptable to "MODE'}.b) The yield W of an aetual-STOWED-deelarator D is determined asfollows:Case A: 'STOWED" is some 'structured with FIELDS mode':• the constituent declarers of D are elaborated collaterally:• each field of W is a variant {4.4.2.c}(i) of the yield of the last constituent MODE-declarer of D occurringbefore the constituent defining-field-selector of D selecting {2.1.5.g} thatfield,(ii) for that 'MODE':Case B: 'STOWED' is some 'ROWS of MODE':• all the constituent lower-bounds and upper-bounds of D and thedeclarer D1 of D are elaborated collaterally;For i = 1 ..... n, where n is the number of 'row's contained in "ROWS',• let I. be the yield of the lower-bound, if any, of the i-th constituentrow-rower of D, and be 1 otherwise;• let u. be the yield of the upper-bound of that row-rower;• W is composed of(i) a descriptor ((I 1, u 1) .....(I n, Un)),(ii) variants of the yield of D1, for 'MODE';Case C: 'STOWED' is some "flexible ROWS of MODE':• W is the yield of the declarer of D.c) The scene S "developed from" an actual-STOWEI)-deelarer D in anenviron E is determined as follows:If the visible direct descendent D1 of D is a mode-indication,then• S is the scene developed from that yielded by D1 in E;otherwise {D1 is a declarator},• S is composed of D1 and E.d) A given MOlD-declarer "specifies" the mode 'MOLD'.4.7. Relationships between modes{Some modes must be deflexed because the mode of a value may notbe flexible (2.1.3.6.b). Incestuous unions must be prevented in order toavoid ambiguities. A set of "UNITED's and 'MOODS's may be ravelled byreplacing all those 'UNITED's by their component 'MOODS's.}4.7.1. SyntaxA)B)C)a)b)c)d)e)ALGOL <strong>68</strong> Revised Report 75NONSTOWED :: PLAIN ; REF to MODE ; PROCEDURE ; UNITED ;void.MOODSETY :: MOODS ; EMPTY.MOIDSETY :.. MOLDS ; EMPTY.WHETHER NONSTOWED deflexes to NONSTOWED{b,e,46b,521c,62a,71n} : WHETHER true.WHETHER FLEXETY ROWS of MODEl deflexes toROWS of MODE2{b,e,46b,521c,62a,71n} :WHETHER MODEl deflexes to MODE2{a,b,c,-}.WHETHER structured with FIELDSI mode deflexes tostructured with FIELDS2 mode{b,e,46b,521c,62a,71n} :WHETHER FIELDSI deflexes to FIELDS2[d,e,-}.WHETHER FIELDSI FIELDI deflexes to FIELDS2 FIELD2{c,d} :WHETHER FIELDSI deflexes to FIELDS2{d,e,-}and FIELDI deflexes to FIELD2{e,-}.WHETHER MODEl field TAG deflexes to MODE2 field TAG{c,d} :WHETHER MODEl deflexes to MODE2{a,b,c,-}.f) WHETHER MOODSETYI with MOODSETY2 incestuous{f,46s} :where (MOODSETY2) is (MOOD MOODSETY3),WHETHER MOODSETYI MOOD with MOODSETY3 incestuous{f}or MOOD is firm union of MOODSETYI MOODSETY3 mode{71m} ;where (MOODSETY2) is (EMPTY), WHETHER false.g) WHETHER MOLDS ravels to MOODS{g,46s} :where (MOLDS) is (MOODS), WHETHER true ;where (MOLDS) is(MOODSETY union of MOODSI mode MOIDSETY),WHETHER MOODSETY MOODSI MOIDSETY ravels to MOODS{g}.{A component mode of a union may not be firmly coerced to one of theother component modes or to the union of those others (rule f) for,otherwise, ambiguities could arise. For example,union (ref int, int) (Ioc int),is ambiguous in that dereferencing may or may not occur before theuniting. Similarly,mode szp = union (szeredi, peter);union (ref szp, szp) (Ioc szp)is ambiguous. Note that, because of ravelling (rule g), the mode specifiedby the declarer of the east is more closely suggested by union (ref szp,szeredi, peter).}
76 van Wijngaarden, et al.4.8. Indicators and field selectors4.8.1. SyntaxA) INDICATOR :: identifier ; mode indication ; operator.B) DEFIED :: defining ; applied.C) PROPSETY :: PROPS ; EMPTY.D) PROPS :: PROP ; PROPS PROP.E) PROP :: DEC ; LAB ; FIELD.F) QUALITY : :MODE ; MOlD TALLY ; DYADIC ; label ; MODE field.G) TAX :: TAG ; TAB ; TAD ; TAM.a)b)c)d)e)f)[Examples:QUALITY NEST new PROPSETYI QUALITY TAX PROPSETY2defining INDICATOR with TAX{32c,35b,42b,43b,44e,f,45c, 541f} :where QUALITY TAX independent PROPSETYI PROPSETY2{71a,b,c}, TAX{942A,D,F,K} token.QUALITY NEST applied INDICATOR with TAX{42c,46a,b,5D,542a,b,544a} :where QUALITY TAX identified in NEST{72a},TAX{942A,D,F,K} token.MODE field PROPSETYI MODE field TAG PROPSETY2 definingfield selector with TAG{46f} :where MODE field TAG independent PROPSETYI PROPSETY2{71a,b,e}, TAG {942A} token.MODE field FIELDS applied field selector with TAG{531a} :where MODE field TAG resides in FlELDS{72b,c,-},TAG{942A} token.* QUALITY NEST DEFIED indicator with TAX :QUALITY NEST DEFIED INDICATOR with TAX{a,b}.* MODE DEFIED field selector with TAG :MODE field FIELDS DEFIED field selector with TAG{c,d}.a) x (in reelx, y)c) next (see 1.1.2)4.8.2. Semanticsb) x (inx+y)d) next (in nextoldraft) }a) When a value or a scene Y is "ascribed" to a QUALITY-definingindicator-with-TAX,in an environ E, then 'QUALITY TAX' is made toaccess V inside the locale of E {2.1.2.c}.b) The yield W of a QUALITY-applied-indicator-with-TAX I in anenviron E composed of an environ E1 and a locale I_ is determined asfollows:ALGOL <strong>68</strong> Revised Report 77If L corresponds to a 'DECSETY LABSETY' which envelops {1.1.4.1.c} that'QUALITY TAX',then W is the value or scene, if any, accessed inside L by 'QUALITY TAX'and, otherwise, is undefined;otherwise, W is the yield of I in El.{Consider the following closed-clause, which contains another one:begin co range I coint i = 421, int a : = 5, proc p = void : print (a);begin co range 2 coendreel a; a : = i; pend.By the time a := i is encountered during the elaboration, two newenvirons have been created, one for each range. The defining-identifier i isfirst sought in the newer one, E2, is not found there, and then is soughtand found in the older one, El. The locale of E1 corresponds to 'integralletter i reference to integral letter a procedure yielding void letter p'. Theyield of the applied-identifier i is therefore the value 421 which has beenascribed (a) to 'integral letter i' inside the locale of El. The yield of a, ina := i, however, is found from the locale of E2.When p is called (5.4.3.2.b), its unit is elaborated in an environ E3established around E1 but upon E2 (3.2.2.b). This means that, for scopepurposes, E3 is newer than E2, but the component environ of E3 is El.When a comes to be printed, it is the yield 5 of the reference-to:integralidentifiera declared in the outer range that is obtained.Thus, the meaning of an indicator applied but not defined within aroutine is determined by the context in which the routine was created,rather than that in which it is called.}5. Units{Units are used to program the more primitive actions or to put intoone single piece the larger constructs of Chapter 3.NOTION-coercees are the results of coercion (Chapter 6), but hips arenot; in the ease of ENCLOSED-clauses, any coercions needed areperformed inside them.The syntax below implies, for example, that text oldraft+ "the_end" isparsed as (textoldrafO+ "the.end" since a selection is a 'SECONDARY'whereas a formula is a 'TERTIARY'.)5.1. SyntaxA) UNIT{32d} :: assignation{521a} coercee ;identity relation{522a} coercee ; routine text{541a,b} coercee ;jump{544a} ; skip{552a} ; TERTIARY{B).B) TERTIARY{A,521b,522a} :: ADIC formula{542a,b} coercee ;nihil{524a) ; SECONDARY{C).
- 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 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