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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

164 van Wijngaarden, et al.b) op .a straightin = tintype x) [ ] simplin :c the result of straightening 'x' c ;e) The result of "straightening" a given value Y is a multiple value W{of one dimension} obtained as follows:• it is required that V {if it is a name} be not nil:• a counter i is set to O:• Y is "traversed" {d} using i;• W is composed of a descriptor ((1, i)) and the elements obtained bytraversing V;• if Y is not (is) a name, then the mode of the result is the mode specifiedby [ ] simplout ([ ] simplin).d) A value Y is "traversed", using a counter i, as follows:If Y is (refers to) a value from whose mode that specified by simplout isunited,then• i is increased by one;• the element of W selected by (i) is V:otherwise,Case A: V is {refers to) a multiple value {of one dimension} having adescriptor ((I, u)) :• for j = I ..... u, the element (the subname) of V selected by (j) istraversed using i:Case B: Y is (refers to) a multiple value {of n dimensions, n >_ 2} whosedescriptor is ((I 1, Ul), 02 , u2) ..... (I n , u )) where n >_ 2:n• for j= 11 ..... u 1, the multiple value selected {2.1.3.4.i} by (thename generated {2.1.3.4.j} by) the trim (j, 0 2, u 2, 0) .....(I n, u n, 0))is traversed using i;Case C: Y is (refers to) a structured value VI:• the fields (the subnames of V referring to the fields) of Yl, takenin order, are traversed using i.10.3.3. Formatless transput{In formatless transput, the elements of a "data list" are transput, oneafter the other, via a specified file. Each element of the data list is eithera layout routine of the mode specified by proc (raf file) void (10.3.1.6) or avalue of the mode specified by outtype (on output) or intype (on input). Onencountering a layout routine in the data list, that routine is called withthe specified file as parameter. Other values in the data list are firststraightened {10.3.2.3) and the resulting values are then transput via thegiven file one after the other.Transput normally takes place at the current position but, if there is noroom on the current line (on output) or if a readable value is not presentthere (on input), then first, the event routine corresponding to on line endALGOL <strong>68</strong> Revised Report 165(or, where appropriate, to on page end, on physical file end oron logical file end) is called, and next, if this returns false, the next "good"character position of the book is found, viz., the first character position ofthe next nonempty line.}10.3.3.1. Formatless output{For formatless output, put (a) and print (or write) (10.5.l.d) may beused. Each straightened value Y from the data list is output as follows:aa) If the mode of V is specified by L int, then first, if there is notenough room for Lint width + 2 characters on the remainder of thecurrent line, a good position is found on a subsequent line (see 10.3.3):next, when not at the beginning of a line, a space is given and then V isoutput as if under the control of the picture n(L int width - 1)z + d.bb) If the mode of V is specified by L real, then first, if there is notenough room for L ~eal width + L exp width + 5 characters on the currentline, then a good position is found on a subsequent line; next, when not atthe beginning of a line, a space is given and then V is output as if undercontrol of the picture+d. n(L real width - 1)den(L exp width - 1)z +d.ce) If the mode of V is specified by L compl, then first, if there is notenough room for 2 x (L real width + L exp width) + 11 characters on thecurrent line, then a good position is found on a subsequent line; next,when not at the beginning of a line, a space is given and then Y is outputas if under eontrol of the picture+d. n(L real width - 1)den(L exp width - 1)z +d". "i+d. n(L real width - 1)den(L exp width - 1)z +d.dd) If the mode of Y is specified by bool, then first, if the current lineis full, a good position is found on a subsequent line; next, if Y is true(false), the character yielded by flip (flop) is output (with no interveningspace).ee) If the mode of V is specified by L bits, then the elements of theonly field of V are output (as in dd) one after the other (with nointervening spaces, and with new lines being taken as required).ff) If the mode of V is specified by char, then first, if the current lineis full, a good position is found on a subsequent line; next V is output (withno intervening space).gg) If the mode of V is specified by [ J char, then the elements of Yare output (as in ff) one after the other (with no intervening spaces, andwith new lines being taken as required).}

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

Saved successfully!

Ooh no, something went wrong!