Previous

10.5. The particular preludes and postludes

10.5.1. The particular preludes
The representation of the particular-prelude of each user-task is obtained from the following forms, to which may be added such other forms as may be needed for the proper functioning of the facilities defined in the constituent library-prelude of the program-text {, e.g., declarations and calls of open for additional standard files}. However, for each QUALITY-new-new-PROPS1-LAYER2-defining-indicator-with-TAX contained in such an additional form, the predicate 'where QUALITY TAX independent PROPS1' {7.1.1.a, c } must hold {i.e., no declaration contained in the standard-prelude may be contradicted} .

a) {L} INT {l} last random := ROUND({l} maxint / {L} 2);

b) PROC {l} random = {L} REAL: {l} next random({l} last random);

c) FILE stand in, stand out, stand back; open(stand in, "", stand in channel); open(stand out, "", stand out channel); open(stand back, "", stand back channel);

d) PROC print = ([ ] UNION(OUTTYPE, PROC(REF FILE )VOID) x)VOID: put(stand out, x), PROC write = ([ ] UNION(OUTTYPE, PROC(REF FILE )VOID) x)VOID: put(stand out, x);

e) PROC read = ([ ] UNION(INTYPE, PROC(REF FILE )VOID) x)VOID: get(stand in, x);

f) PROC printf = ([ ] UNION(OUTTYPE, FORMAT) x)VOID: putf(stand out, x), PROC writef = ([ ] UNION(OUTTYPE, FORMAT) x)VOID: putf(stand out, x);

g) PROC readf = ([ ] UNION(INTYPE, FORMAT) x)VOID: getf(stand in, x);

h) PROC write bin = ([ ] OUTTYPE x)VOID: put bin(stand back, x);

i) PROC read bin = ([ ] INTYPE x)VOID: get bin(stand back, x);


10.5.2. The particular postludes
The representation of the particular-postlude of each user-task is obtained from the following form, to which may be added such other forms as may be needed for the proper functioning of the facilities defined in the constituent library-prelude of the program-text {, e.g., calls of lock for additional standard files}.

a) stop: lock(stand in); lock(stand out); lock(stand back)
 
Next