10.07.2015 Views

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!