150van Wijngaarden, et al.ALGOL <strong>68</strong> Revised Report 151e)doif match (idf, chan, book of bf)then found : = trueelse bf : = next of bffiod;if - foundthen up bfileprotect; undefinedelse ref book book := book of bf;if putting of book v (put of chan) (book) ^ users of book > 0thenup bfileprotect; undefined ¢ in this case opening isinhibited by other users - the system may eitherwait, or yield nonzero (indicating unsuccessfulopening) immediately ¢elseusers of book +: = 1;((put of chan) (book) t putting of book : = true);ref ref bflle (bf) := next of bf; ¢ remove bfile from chain ¢(opened of file I up gremlins I up bfileprotect);file :=(book, text of book, chan, skip, skip,¢ state: ¢ heap bool : = false, heap bool : = false,heap bool : = false, heap bool : = false,heap bool : = true,heap pos := (1, 1, 1), "", (standconv of chan) (book),¢ event routines: ¢ false, false, false, false, false,false, (ref file f, ref char a) bool : false);(- bin possible (file) I set char mood (file));(~ get possible (file) I set write mood (file));(- put possible (file) I set read mood (file));0fifielse up bfileprotect; undefinedfiend;proc associate =(ref file file, ref [ ] [ ] [ J char sss) void :if int p = lwb sss; int l = lwb sss [p J; int c = lwb sss IPI [ l ];p=1^1=1^c=1thenproc t = (ref book a) bool : true;proc f = (ref book a) bool : false;channel chan = (t, t, t, t, f, f, f, bool: false,pos : (max int, max int, max int), skip, skip);(opened of file I down bfileprotect; up gremlins);f)g)h)i)J)k)file : =(heap book := (skip, (upb sss + I, 1, 1), skip, true, 1), sss, than,skip, skip,¢ state: ¢ heap bool : = false, heap bool : = false,heap bool : = true, heap bool : = false, heap bool : = true,heap pos := (1, 1, i), "', skip,¢ event routines: ¢ false, false, false, false, false,, false,(ref file f, ref char a) bool : false)else undefinedJfi;proc .~ file available = (channel chan) bool :c true if another file, at this instant of time, may be opened on'chan' and false otherwise c ;proc .~ idf ok = (string idf) bool :c true if 'idf' is acceptable to the implementation as theidentification of a new book and false otherwise c ;proc .~ match =(string idf, channel chan, ref book book name)boo/:c true if the book referred to by 'book name' may be identified by'idf', and if the book may legitimately be accessed through'chan', and false otherwise c ;proc .~ false = (ref file file) bool : false¢ this is included for brevity in 'establish', 'open' and 'associate' ¢ ;proc .~ set write mood = (ref file f) void :if - put possible (f) v- setpossible (f) ^ bin mood off ^ read mood offthen undefinedelse ref bool (read mood off) := false; ref bool (write mood off: := truefi;proc .~ set read mood = (ref file f) void :if - get possible (f) v- setpossible (f) ^ bin mood off ^ write mood offthen undefinedelse ref bool (read mood off) : = true; ref bool (write mood off) : = falsefi;proc .~ set char mood = (ref file f) void :Sif - set possible (f) ^ bin mood offthen undefinedelse ref bool (char mood off) := true; ref bool (bin mood off) : = falsefi;
152van Wijngaarden, et al.ALGOL <strong>68</strong> Revised Report 153m)n)o)P)proc .~ set bin mood = (rot file f) void :if" bin possible (f) v . set possible (f) ^ char mood offthan undefinedelse ref bool (char mood off):= false; ref bool (bin mood off/:= truefi;proc close = (ref file file) void :if opened of filethendown bfileprotect;ref bool (opened of file) := false;ref book book = book of file;putting of book := false; users of book -: = 1;(text of file I (flextext): ckainbfile :=PRIM bflle := (book, chainbfile));up gremlinsfl;proc lock = (ref file file) void :if opened of filethendown bfileprotect;ref bool (opened of file) := false;ref book book = book of file;putting of book := false; users of book -:= 1;(text of file I (flexlext): lockedbfile :=PRIM bflle : = (book, lockedbfile));up gremlinsfi;proc scratch = (ref file file) void :if opened of filethendown bfileprotect;ref bool (opened of file) := false;putting of book of file : = false;users of book of file -: = 1;up gremlinsfl;10.3.1.5. Position enquiries{aa) The "current position" of a book opened on a given file is thevalue referred to by the cpos field of that file. It is advanced by eachtransput operation in accordance with the number of characters written orread.If c is the current character number and Ib is the length of thecurrent line, then at all times 1 c of book bounds (f)) ;
- 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 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