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.

188 van Wijngaar~en, et al.ALGOL <strong>68</strong> Revised Report189then• the literal yielded by the V-th literal is staticized and performed:otherwise,• the event routine corresponding to on value error is called:• if this returns false, V is output using put and undefined is called:• the insertion of P is staticized and performed.bb) A value is input to a name N using a picture P whose pattern Qwas yielded by an integral-choice-pattern C as follows:• the insertion of Q is staticized and performed:• each of the literals yielded by the constituent literals of the praglit-listpackof C is staticized and "searched for" (cc) in turn:If the mode of N is specified by tel int and the i-th literal is the first onepresent,then i is assigned to N:otherwise,• the event routine corresponding to on value error is called:• if this returns false, undefined is called:• the insertion of P is staticized and performed.cc) A literal is "searched for" by reading characters and matchingthem against successive characters of the literal. If the end of the currentline or the logical end of the file is reached, or if a character fails tomatch, the search is unsuccessful and the current position is returned towhere it started from.dd) A value V is output using a picture P whose pattern Q was yieldedby a boolean-choice-pattern C as follows:• the insertion of Q is staticized and performed:If the mode of V is specified by bool.then• if V is true (false), the literal yielded by the first (second) constituentliteral of C is staticized and performed:otherwise,• the event routine corresponding to on value error is called:• if this returns false, V is output using put and undefined is called:• the insertion of P is staticized and performed.ee) A value is input to a name N using a picture P whose pattern Qwas yielded by a boolean-choice-pattern C as follows:• the insertion of O is staticized and performed:• each of the literals yielded by the constituent literals of C is staticizedand searched for in turn:If the mode of hi is specified by ret bool, and the first (second) insertion ispresent,then true (false) is assigned to N:otherwise,• the event routine corresponding to on value error is called:• if this returns false, undefined is called:• the insertion of P is staticized and performed.}10.3.4.8.2. SemanticsThe yield of a choice-pattern P is a structured value W whose mode is"CPATTERN', determined as follows:• let n be the number of constituent NEST-literals of the praglit-list-packof P;• let S i, i = 1 ..... n, be a NEST-insertion akin {1.1.3.2.k} to the i-th of thoseconstituent NEST-literals;• the insertion I of P and all of S 1, S 2 ..... S n are elaboratedcollaterally;• the fields of W, taken in order, are• {i} the yield of I;• {type} 1 ~2) if P is a boolean- (integral-) -choice-pattern;• {c} a multiple value whose mode is "row of INSERTION', having adescriptor ((1, n)) and n elements, that selected by (i), i= 1 ..... n,being the yield of S..I10.3.4.9. Format patterns10.3.4.9.1. Syntaxa) NEST format pattern{A341c} :NEST insertion{A341d}, letter f{94a} symbol,meek FORMAT NEST ENCLOSED clause{31a,34a},pragment{92a} sequence option.{Example:a) f (uir[ (int): $5d$, (real): $ d.3d $) }{A format-pattern may be used to provide formats dynamically for usein transput. When a 'format' pattern is encountered during a call ofget next picture, it is staticized and its insertion is performed. The firstpicture of the format returned by the routine of the pattern is supplied asthe next picture, and subsequent pictures are taken from that format untilit has been exhausted.}10.3.4.9.2. SemanticsThe yield, in an environ E, of a NEST-format-pattern P is a structuredvalue whose mode is "FPATTERN' and whose fields, taken in order, are• {i} the yield of its insertion;• {p[} a routine whose mode is "procedure yielding FORMAT',

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

Saved successfully!

Ooh no, something went wrong!