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.

76 van Wijngaarden, et al.4.8. Indicators and field selectors4.8.1. SyntaxA) INDICATOR :: identifier ; mode indication ; operator.B) DEFIED :: defining ; applied.C) PROPSETY :: PROPS ; EMPTY.D) PROPS :: PROP ; PROPS PROP.E) PROP :: DEC ; LAB ; FIELD.F) QUALITY : :MODE ; MOlD TALLY ; DYADIC ; label ; MODE field.G) TAX :: TAG ; TAB ; TAD ; TAM.a)b)c)d)e)f)[Examples:QUALITY NEST new PROPSETYI QUALITY TAX PROPSETY2defining INDICATOR with TAX{32c,35b,42b,43b,44e,f,45c, 541f} :where QUALITY TAX independent PROPSETYI PROPSETY2{71a,b,c}, TAX{942A,D,F,K} token.QUALITY NEST applied INDICATOR with TAX{42c,46a,b,5D,542a,b,544a} :where QUALITY TAX identified in NEST{72a},TAX{942A,D,F,K} token.MODE field PROPSETYI MODE field TAG PROPSETY2 definingfield selector with TAG{46f} :where MODE field TAG independent PROPSETYI PROPSETY2{71a,b,e}, TAG {942A} token.MODE field FIELDS applied field selector with TAG{531a} :where MODE field TAG resides in FlELDS{72b,c,-},TAG{942A} token.* QUALITY NEST DEFIED indicator with TAX :QUALITY NEST DEFIED INDICATOR with TAX{a,b}.* MODE DEFIED field selector with TAG :MODE field FIELDS DEFIED field selector with TAG{c,d}.a) x (in reelx, y)c) next (see 1.1.2)4.8.2. Semanticsb) x (inx+y)d) next (in nextoldraft) }a) When a value or a scene Y is "ascribed" to a QUALITY-definingindicator-with-TAX,in an environ E, then 'QUALITY TAX' is made toaccess V inside the locale of E {2.1.2.c}.b) The yield W of a QUALITY-applied-indicator-with-TAX I in anenviron E composed of an environ E1 and a locale I_ is determined asfollows:ALGOL <strong>68</strong> Revised Report 77If L corresponds to a 'DECSETY LABSETY' which envelops {1.1.4.1.c} that'QUALITY TAX',then W is the value or scene, if any, accessed inside L by 'QUALITY TAX'and, otherwise, is undefined;otherwise, W is the yield of I in El.{Consider the following closed-clause, which contains another one:begin co range I coint i = 421, int a : = 5, proc p = void : print (a);begin co range 2 coendreel a; a : = i; pend.By the time a := i is encountered during the elaboration, two newenvirons have been created, one for each range. The defining-identifier i isfirst sought in the newer one, E2, is not found there, and then is soughtand found in the older one, El. The locale of E1 corresponds to 'integralletter i reference to integral letter a procedure yielding void letter p'. Theyield of the applied-identifier i is therefore the value 421 which has beenascribed (a) to 'integral letter i' inside the locale of El. The yield of a, ina := i, however, is found from the locale of E2.When p is called (5.4.3.2.b), its unit is elaborated in an environ E3established around E1 but upon E2 (3.2.2.b). This means that, for scopepurposes, E3 is newer than E2, but the component environ of E3 is El.When a comes to be printed, it is the yield 5 of the reference-to:integralidentifiera declared in the outer range that is obtained.Thus, the meaning of an indicator applied but not defined within aroutine is determined by the context in which the routine was created,rather than that in which it is called.}5. Units{Units are used to program the more primitive actions or to put intoone single piece the larger constructs of Chapter 3.NOTION-coercees are the results of coercion (Chapter 6), but hips arenot; in the ease of ENCLOSED-clauses, any coercions needed areperformed inside them.The syntax below implies, for example, that text oldraft+ "the_end" isparsed as (textoldrafO+ "the.end" since a selection is a 'SECONDARY'whereas a formula is a 'TERTIARY'.)5.1. SyntaxA) UNIT{32d} :: assignation{521a} coercee ;identity relation{522a} coercee ; routine text{541a,b} coercee ;jump{544a} ; skip{552a} ; TERTIARY{B).B) TERTIARY{A,521b,522a} :: ADIC formula{542a,b} coercee ;nihil{524a) ; SECONDARY{C).

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

Saved successfully!

Ooh no, something went wrong!