186van Wijngaarden, et al./ALGOL <strong>68</strong> Revised Report 18710.3.4.6. String patterns10.3.4.6.1. Syntaxa) NEST string pattern{A341c} :NEST character frame{A341k} sequence.b) character marker{A341k} : letter a{94a} symbol.{Example:a) p "table of"x lOa }{For the semantics of string-patterns see 10.3.4.1.2.e.}{aa) The modes which are output (input) compatible with a "string"pattern are those specified by char and [ ] char (by ref char, raf [ ] charand ref string).bb) A value V is converted to a string using a "string' pattern P asfollows:• if necessary, Y is rowed to a string;• if the length of the string Y is equal to the length of the string controlledby P, then V is supplied; otherwise, the conversion is unsuccessful.cc) A string S is converted to a character or a string suitable for aname N, using a 'string' pattern, as follows:Case A: The mode of N is specified by ref char:• if S does not consist of one character, the conversion isunsuccessful; otherwise, that character is supplied;Case B: The mode of N is specified by rof [ ] char:• if the length of S is not equal to the number of characters referredto by N, the conversion is unsuccessful; otherwise, S is supplied;Case C: The mode of N is specified by rat string:• S is supplied.}10.3.4.7. Bits patterns10.3.4.7.1. Syntaxa)b)c){Examples:NEST bits pattern{A341c} :NEST RADIX frame{b}, NEST integral mouid{A342b}.NEST RADIX frame{a} : NEST insertion{A341d}, RADIX{82d,e,f,g},unsuppressible suppression{A3411}, radix marker{c}.radix marker{b} : letter r{94a} symbol.a) 2r6d26sd b) 2r }{For the semantics of bits-patterns see 10.3.4.1.2.e.}{aa) The modes which are output (input) compatiblepattern are those specified by L bits (refL bits).with a'bits'bb) A value V is converted to a string using a 'bits' pattern P asfollows:• the integer I corresponding to V is determined, using the operator abs(10.2.3.8.i) ;If the "r" frame of P was yielded by a radix-two- (-four-, -eight-, -sixteen-)-frame,then ! is converted to a string, controlled by the integral mould of P,containing a binary (quaternary, octal, hexadecimal) representation ofI (cf. 10.3.4.2.1.bb):• if I cannot be represented by such a string, the conversion isunsuccessful.cc) A string S is converted to a bits value suitable for a name N,using a 'bits' pattern P, as follows:• if the "r" frame of P was yielded by a radix-two- (-four-, -eight-,-sixteen-) -frame, then the integer I for which S contains a binary(quaternary, octal, hexadecimal) representation is determined;• the bits value B corresponding to I is determined, using the operatorbin (10.2.3.8.j) ;• if the width of B is greater than that of the value to which N refers, theconversion is unsuccessful.}10.3.4.8. Choice patterns10.3.4.8.1. Syntaxa) NEST integral choice pattern{A341c} : NEST insertion{A341d},letter c{94a} symbol, NEST praglit{c} list brief pack,pragment{92a} sequence option.b) NEST boolean choice pattern{A341c} :NEST insertion{A341d}, boolean marker{A344b},brief begin{94f} token, NEST praglit{c}, and also{94f} token,NEST praglit{c}, brief end{94f} token,pragment{92a} sequence option.c) NEST praglit{a,b} : pragment{92a} sequence option,NEST literal{A341i}.{Examples:a) 120k c ("mon", "tues", "wednes", "thurs", "fri", "satur", "sun")b) b ("", "error")c) "mon" }{aa) A value Y is output using a picture P whose pattern Q was yieldedby an integral-choice-pattern C as follows:• the insertion of O is staticized (10.3.4.1.l.dd) and performed(10.3.4.1.l.ee) ;If the mode of V is specified by int, if Y > 0, and if the number ofconstituent literals in the praglit-list-pack of C is at least V,
188 van Wijngaar~en, et al.ALGOL <strong>68</strong> Revised Report189then• the literal yielded by the V-th literal is staticized and performed:otherwise,• the event routine corresponding to on value error is called:• if this returns false, V is output using put and undefined is called:• the insertion of P is staticized and performed.bb) A value is input to a name N using a picture P whose pattern Qwas yielded by an integral-choice-pattern C as follows:• the insertion of Q is staticized and performed:• each of the literals yielded by the constituent literals of the praglit-listpackof C is staticized and "searched for" (cc) in turn:If the mode of N is specified by tel int and the i-th literal is the first onepresent,then i is assigned to N:otherwise,• the event routine corresponding to on value error is called:• if this returns false, undefined is called:• the insertion of P is staticized and performed.cc) A literal is "searched for" by reading characters and matchingthem against successive characters of the literal. If the end of the currentline or the logical end of the file is reached, or if a character fails tomatch, the search is unsuccessful and the current position is returned towhere it started from.dd) A value V is output using a picture P whose pattern Q was yieldedby a boolean-choice-pattern C as follows:• the insertion of Q is staticized and performed:If the mode of V is specified by bool.then• if V is true (false), the literal yielded by the first (second) constituentliteral of C is staticized and performed:otherwise,• the event routine corresponding to on value error is called:• if this returns false, V is output using put and undefined is called:• the insertion of P is staticized and performed.ee) A value is input to a name N using a picture P whose pattern Qwas yielded by a boolean-choice-pattern C as follows:• the insertion of O is staticized and performed:• each of the literals yielded by the constituent literals of C is staticizedand searched for in turn:If the mode of hi is specified by ret bool, and the first (second) insertion ispresent,then true (false) is assigned to N:otherwise,• the event routine corresponding to on value error is called:• if this returns false, undefined is called:• the insertion of P is staticized and performed.}10.3.4.8.2. SemanticsThe yield of a choice-pattern P is a structured value W whose mode is"CPATTERN', determined as follows:• let n be the number of constituent NEST-literals of the praglit-list-packof P;• let S i, i = 1 ..... n, be a NEST-insertion akin {1.1.3.2.k} to the i-th of thoseconstituent NEST-literals;• the insertion I of P and all of S 1, S 2 ..... S n are elaboratedcollaterally;• the fields of W, taken in order, are• {i} the yield of I;• {type} 1 ~2) if P is a boolean- (integral-) -choice-pattern;• {c} a multiple value whose mode is "row of INSERTION', having adescriptor ((1, n)) and n elements, that selected by (i), i= 1 ..... n,being the yield of S..I10.3.4.9. Format patterns10.3.4.9.1. Syntaxa) NEST format pattern{A341c} :NEST insertion{A341d}, letter f{94a} symbol,meek FORMAT NEST ENCLOSED clause{31a,34a},pragment{92a} sequence option.{Example:a) f (uir[ (int): $5d$, (real): $ d.3d $) }{A format-pattern may be used to provide formats dynamically for usein transput. When a 'format' pattern is encountered during a call ofget next picture, it is staticized and its insertion is performed. The firstpicture of the format returned by the routine of the pattern is supplied asthe next picture, and subsequent pictures are taken from that format untilit has been exhausted.}10.3.4.9.2. SemanticsThe yield, in an environ E, of a NEST-format-pattern P is a structuredvalue whose mode is "FPATTERN' and whose fields, taken in order, are• {i} the yield of its insertion;• {p[} a routine whose mode is "procedure yielding FORMAT',
- 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 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 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