Previous

4.7. Relationships between modes

{Some modes must be deflexed because the mode of a value may not be flexible {2.1.3.6.b }. Incestuous unions must be prevented in order to avoid ambiguities. A set of 'UNITED's and 'MOODS's may be ravelled by replacing all those 'UNITED's by their component 'MOODS's.}

4.7.1. Syntax

A) NONSTOWED :: PLAIN ; REF to MODE ; PROCEDURE ; UNITED ; void.

B) MOODSETY :: MOODS ; EMPTY.

C) MOIDSETY :: MOIDS ; EMPTY.

a) WHETHER NONSTOWED deflexes to NONSTOWED {b,e,46b ,521c,62a,71n} : WHETHER true.

b) WHETHER FLEXETY ROWS of MODE1 deflexes to ROWS of MODE2{b,e,46b ,521c,62a,71n} : WHETHER MODE1 deflexes to MODE2{a,b,c,-}.

c) WHETHER structured with FIELDS1 mode deflexes to structured with FIELDS2 mode{b,e,46b ,521c,62a,71n} : WHETHER FIELDS1 deflexes to FIELDS2{d,e,-}.

d) WHETHER FIELDS1 FIELD1 deflexes to FIELDS2 FIELD2{c,d} : WHETHER FIELDS1 deflexes to FIELDS2{d,e,-} and FIELD1 deflexes to FIELD2{e,-}.

e) WHETHER MODE1 field TAG deflexes to MODE2 field TAG{c,d} : WHETHER MODE1 deflexes to MODE2{a,b,c,-}.

f) WHETHER MOODSETY1 with MOODSETY2 incestuous{f,46s } : where (MOODSETY2) is (MOOD MOODSETY3), WHETHER MOODSETY1 MOOD with MOODSETY3 incestuous{f} or MOOD is firm union of MOODSETY1 MOODSETY3 mode {71m } ; where (MOODSETY2) is (EMPTY), WHETHER false.

g) WHETHER MOIDS ravels to MOODS{g,46s } : where (MOIDS) is (MOODS), WHETHER true ; where (MOIDS) is (MOODSETY union of MOODS1 mode MOIDSETY), WHETHER MOODSETY MOODS1 MOIDSETY ravels to MOODS{g}.

{A component mode of a union may not be firmly coerced to one of the other component modes or to the union of those others (rule f) for, otherwise, ambiguities could arise. For example,

UNION(REF INT, INT) (LOC INT)
is ambiguous in that dereferencing may or may not occur before the uniting. Similarly,
MODE SZP = UNION(SZEREDI, PETER);
UNION(REF SZP, SZP) (LOC SZP)
is ambiguous. Note that, because of ravelling (rule g), the mode specified by the declarer of the cast is more closely suggested by UNION(REF SZP, SZEREDI, PETER).}

4.8. Indicators and field selectors

4.8.1. Syntax

A) 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 ; MOID TALLY ; DYADIC ; label ; MODE field.

G) TAX :: TAG ; TAB ; TAD ; TAM.

a) QUALITY NEST new PROPSETY1 QUALITY TAX PROPSETY2 defining INDICATOR with TAX {32c ,35b,42b,43b,44c,f,45c,541f} : where QUALITY TAX independent PROPSETY1 PROPSETY2 {71a,b,c } , TAX{942A,D,F,K } token.

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

c) MODE field PROPSETY1 MODE field TAG PROPSETY2 defining field selector with TAG{46f } : where MODE field TAG independent PROPSETY1 PROPSETY2{71a,b,c } , TAG {942A} token.

d) MODE field FIELDS applied field selector with TAG{531a } : where MODE field TAG resides in FIELDS{72b,c ,-}, TAG{942A } token.

e) *QUALITY NEST DEFIED indicator with TAX : QUALITY NEST DEFIED INDICATOR with TAX{a,b}.

f) *MODE DEFIED field selector with TAG : MODE field FIELDS DEFIED field selector with TAG{c,d}.

{Examples:

}

a)
x (in REAL x, y)
b)
x (in x + y)
c)
next (see 1.1.2 )
d)
next (in next OF draft)

4.8.2. Semantics

a) When a value or a scene V is "ascribed" to a QUALITY-defining-indicator-with-TAX, in an environ E, then 'QUALITY TAX' is made to access V inside the locale of E {2.1.2.c }.

b) The yield W of a QUALITY-applied-indicator-with-TAX I in an environ E composed of an environ E1 and a locale L is determined as follows:

If 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 E1.
{Consider the following closed-clause, which contains another one:
BEGIN CO range 1 CO
    INT i = 421, INT a := 5, PROC p = VOID: print(a);
    BEGIN CO range 2 CO
        REAL a; a := t; p
    END
END 
.
By the time a := i is encountered during the elaboration, two new environs have been created, one for each range. The defining-identifier i is first sought in the newer one, E2, is not found there, and then is sought and found in the older one, E1. The locale of E1 corresponds to 'integral letter i reference to integral letter a procedure yielding void letter p'. The yield of the applied-identifier i is therefore the value 421 which has been ascribed {a}to 'integral letter i' inside the locale of E1. The yield of a, in a := 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 E3 established around E1 but upon E2 {3.2.2.b }. This means that, for scope purposes, E3 is newer than E2, but the component environ of E3 is E1. When a comes to be printed, it is the yield 5 of the reference-to-integral-identifier a declared in the outer range that is obtained.

Thus, the meaning of an indicator applied but not defined within a routine is determined by the context in which the routine was created, rather than that in which it is called.}
 
Next