next up previous
Next: Operational Semantics Up: Modular Language Previous: Expansion and Contraction

Special declarations

We shall complete this Section by brieftly commenting on the different types of module declarations allowed in Milord II. Open and Inherit submodule declarations are only programming facilities and they do not belong to the primitives of the modular language. Open bodyexpr means that we will not give a name to the submodule, the practical consequence is that exported facts of open modules can be directly referenced, without any path prefixing them, as if they were textually defined in the module containing the open declaration, the same happens to submodules of an open submodule that are considered as if they were direct submodules of the module containing the open declararation. Inherit A is an equivalent expression for Module A = A. The complete syntax of the hierarchy component of modules is given in Figure 17.

Figure 17: Syntax of submodule definition.

It is easy to see that name clashes can occur when we use declarations by means of open. If a module has more than one opened submodule, the names of the exported facts must be differentgif.

Josep Puyol-Gruart
Thu Oct 23 15:34:13 MET DST 1997