As can be seen in the syntax diagram for a unit, a unit name can contain dots. This means that the units can be organized in namespaces.
So, the following is a correct unit declaration:
The unit can be used as follows:
When resolving symbols, unit scopes always take precedence over symbols inside units.
Given the following units:
and
The following program will resolve myunit.test.a to the variable a in unit myunit.test:
So it will print:
Reversing the order of the units will not change this:
will also print
Similarly, the following program will resolve myunit.test.a to the variable a in unit myunit.test:
it will print:
Similarly, the following program will resolve test.a to the variable test.a in unit myunit:
will print