[top] [prev] [next]

Import statements

There are two forms of import statements. All imports of both forms are interpreted simultaneously: their order doesn't matter.

The first form is

    IMPORT I AS J
which imports the interface whose global name is I and gives it the local name J. The entities and revelations declared in I become accessible in the importing module or interface, but the entities and revelations imported into I do not. To refer to the entity declared with name N in the interface I, the importer must use the qualified identifier J.N.

The statement IMPORT I is short for IMPORT I AS I.

The second form is

    FROM I IMPORT N
which introduces N as the local name for the entity declared as N in the interface I. A local binding for I takes precedence over a global binding. For example,
    IMPORT I AS J, J AS I; FROM I IMPORT N
simultaneously introduces local names J, I, and N for the entities whose global names are I, J, and J.N, respectively.

It is illegal to use the same local name twice:

    IMPORT J AS I, K AS I;
is a static error, even if J and K are the same.

[top] [prev] [next]