CM's group model eliminates a whole class of potential naming problems by providing control over name spaces for program linkage. The group model in full generality sometimes requires bindings to be renamed at the time of import. As has been described separately [BA99], in the case of ML this can also be achieved using ``administative'' libaries, which is why CM can get away with not providing more direct support for renaming.
However, under CM, the term ``library'' does not only mean namespace management (as it would from the point of view of the pure group model) but also refers to actual file system objects (e.g., CM description files and stable library files). It would be inconvenient if name resolution problems would result in a proliferation of additional library files. Therefore, CM also provides the notion of library components (``groups''). Name resolution for groups works like name resolution for entire libraries, but grouping is entirely internal to each library.
When a library is stabilized (via CM.stabilize - see Section 2.8), the entire library is compiled to a single file (hence groups do not result in separate stable files).
During development, each group has its own description file which will be referred to by the surrounding library or by other groups of that library. The syntax of group description files is the same as that of library description files with the following exceptions:
As an example, let us assume that foo-utils.cm contains the following text:
Group (foo-lib.cm)
is
set-util.sml
map-util.sml
$/basis.cm
This description defines group foo-utils.cm to have the following properties:
With this, the library description file foo-lib.cm could list foo-utils.cm as one of its members:
Library
signature FOO
structure Foo
is
foo.sig
foo.sml
foo-utils.cm
$/basis.cm
No harm is done if foo-lib.cm does not actually mention
foo-utils.cm. In this case it could be that
foo-utils.cm is mentioned indirectly via a chain of other components
of foo-lib.cm. The other possibility is that it is not
mentioned at all (in which case CM would never know about it, so it
cannot complain).