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.

80 ) van Wijngaarden, et al.5.2.2.1. Syntaxa)b){Examples:boolean NEST identity relation{5A} :where soft balances SORTI and SORT2{32f},SORTI reference to MODE NEST TERTIARYI{5B},identity relator{b},SORT2 reference to MODE NEST TERTIARY2{5B}.identity relator{a} : is{94f} token ; is not{94f} token.a) next of draft :=: refbook (nil)b) :=: •:~: }5.2.3.1. Syntax{LEAP :: local ; heap ; primal.}ALGOL <strong>68</strong> Revised Reporta) reference to MODE NEST LEAP generator{5C} : LEAP{94d,-} token,actual MODE NEST declarer{46a}.b) reference to MODINE NEST LEAP sample generator{44e} :LEAP{94d,-} token, actual MODINE NEST declarer{44b,46a} ;where (LEAP) is (local), actual MODINE NEST declarer{44b,46a}.{Examples:a) Ioc real b) Ioc real • real }{There is no representation for the primal-symbol (see 9.4.a).}81{Observe that al [i] :=: al [j] is not produced by this syntax. Thecomparison, by an identity-relation, of transient names (2.1.3.6.c) is thusprevented.}5.2.2.2. SemanticsThe yield W of an identity-relation I is determined as follows:• let N1 and N2 be the {collateral} yields of the TERTIARYs of I;Case A: The token of the identity-relator of I is an is-token:• W is true if {the name} N1 is the same as N2, and is false otherwise;Case B: The token of the identity-relator of I is an is-not-token:• W is true if N1 is not the same as N2, and is false, otherwise.5.2.3. Generators{And as imagination bodies forthThe forms of things unknown, the poet'spenTurns them to shapes, and gives to airynothingA local habitation and a name.A Midsummer-night's Dream,William Shakespeare.}{The elaboration of a generator, e.g., Ioc real in xx := loc real := 3.14,or of a sample-generator, e.g., [i : n} char in [I : n} char u, v;, involvesthe creation of a name, i.e., the reservation of storage.The use of a local-generator implies (with most implementations) thereservation of storage on a run-time stack, whereas heap-generators implythe reservation of storage in another region, termed the "heap", in whichgarbage-collection techniques may be used for storage retrieval. Since thisis less efficient, local.generators are preferable; this is why only Ioc maybe omitted from sample-generators of variable-declarations.}5.2.3.2. Semanticsa) The yield W of a LEAP-generator or LEAP-sample-generator G, inan environ E, is determined as follows:• W is a newly created name which is made to refer {2.1.3.2.a} to the yieldin E of the actual-declarer {4.4.2.d, 4.6.2.a} of G:• W is equal in scope to the environ E1 determined as follows:Case A: "LEAP' is 'local':• El is the "local environ" {b} accessible from E:Case B: 'LEAP' is 'heap':• El is {the first environ created during the elaboration of theparticular-program, which is} such that(i) the primal environ {2.2.2.a} is the environ of the environ of theenviron of E1 {sic}, and(ii) El is, or is older than, E;Case C: 'LEAP' is "primal':• El is the primal environ;• if W is a stowed name {2.1.3.2.b}, then W is endowed with subnames{2.1.3.3.e, 2.1.3.4.g}.{The only examples of primal-generators occur in the standard- andsystem-preludes (10.3.1.l.h, 10.3.1.4.b,n,o, 10.4.l.a).When G is a reference-to-routine-sample.generator, the mode of W is ofno relevance.}b) The "local environ" accessible from an environ E is an environ Eldetermined as follows:If E is "nonlocal" {3.2.2.b},then El is the local environ accessible from the environ of E:otherwise, E1 is E.{An environ is nonlocal if it has been established according to a serialclauseor enquiry-clause which contains no constituent mode-, identifier-,or operation.declaration, or according to a for-part (3.5.1.b) or aspecification (3.4.l.j,k) .}

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

Saved successfully!

Ooh no, something went wrong!