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.

184 van Wijngaarden, et al.{Examples:a) +zd.lld • +.12de+2d b) zd.lld • .12dc) .12de+2d }{For the semantics of real-patterns see 10.3.4.1.2.e.}{aa) The modes which are output (input) compatible with a 'real'pattern are those specified by L real and Lint (by refL real).bb) A value V is converted to a string S using a 'real' pattern P asfollows:• if P contains a sign mould, then the first character of S is the sign of V;otherwise, if Y < 0, the conversion is unsuccessful;• the remainder of S contains a decimal representation of V determinedas follows:• if necessary, V is widened to a real number;• the element of S controlled by the "." Ce") frame, if any, of P is "."("lo")"If P contains an "e" frame,then• let W be the sequence of frames preceding, and IP be the'integral' pattern following, that "e" frame:• an exponent E is calculated by standardizing V to the largestvalue convertible using W (see below):• the part of S controlled by IP is obtained by converting E usingIP (see 10.3.4.2.1.bb):otherwise,• let W be the whole of P:• the elements of S controlled by the "d" and "z" frames of W are theappropriate digits (thus the pattern specifies the number of digits to beused, and the number of digits to be placed after the decimal point, ifany);• if V cannot be represented by such a string, the conversion isunsuccessful.cc) A string S is converted to a real number suitable for a name N,using a "real" pattern, as follows:• the real number R for which S contains a decimal representation isconsidered:• if R is greater than the largest value to which N can refer, theconversion is unsuccessful: otherwise, R is the required real number.}10.3.4.4. Boolean patterns10.3.4.4.1. Syntaxa) NEST boolean pattern{A341c} :NEST unsuppressible boolean frame{A341j}.b) boolean marker{A341j,A348b} : letter b{94a} symbol.{Example:a) 14x b }ALGOL <strong>68</strong> Revised Report 185{For the semantics of boolean-patterns see 10.3.4.1.2.e.}{aa) The mode which is output (input) compatible with a "boolean'pattern is that specified by bool (refbool).bb) A value Y is converted to a string using a 'boolean" pattern asfollows:• if Y is true (false), then the string is that yielded by flip (flop).co) A string S is converted to a boolean value, using a "boolean'pattern, as follows:• if S is the same as the string yielded by flip (flop), then the requiredvalue is true (false).}10.3.4.5. Complex patterns10.3.4.5.1. Syntaxa)b){Example:NEST complex pattern{A341c} : NEST real pattern{A343a},NEST complex frame{A341j}, NEST real pattern{A343a}.complex marker{A341j} : letter i{94a} symbol.a) +.12de+2d 3q"+jx"3"." si +.lOde+2d }{For the semantics of complex-patterns see 10.3.4.1.2.e.}{aa) The modes which are output (input) compatible with a 'complex'pattern are those specified by L compl, L real and Lint (by ref L compl).bb) A value V is converted to a string S using a "eomplex' pattern Pas follows: I• if necessary, V is widened to a complex number;• the element of S controlled by the "i" frame of P is ".1_":• the part of S controlled by the first (seeond) "real" pattern of P is thatobtained by converting the first (second) field of V to a string using thefirst (second) 'real' pattern of P (10.3.4.3.!1.bb); /• if either conversion is unsuccessful, the conversion of V is unsuccessful.cc) A string is converted to a complex value C suitable for a name N,using a 'complex' pattern P, as follows:• the part of the string controlled by the first (second) 'real" pattern of Pis converted to a suitable real number ii0.3.,~.3./1.ec)~,)which then forms thefirst (second) field of C; - i - .• if either conversion is unsuccessful, the conversion to C is unsuccessful.}f

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

Saved successfully!

Ooh no, something went wrong!