next up previous contents
Next: 2.3 Invoking CM Up: 2. The CM model Previous: 2.1 Basic philosophy   Contents

2.2 Description files

Technically, a CM library is a (possibly empty) collection of ML source files and may also contain references to other libraries. Each library comes with an explicit export interface which lists all toplevel-defined symbols of the library that shall be exported to its clients. A library is described by the contents of its description file.2

Example:


  Library
      signature BAR
      structure Foo
  is
      bar.sig
      foo.sml
      helper.sml

      $/basis.cm
      $/smlnj-lib.cm

This library exports two definitions, one for a structure named Foo and one for a signature named BAR. The specification for such exports appear between the keywords Library and is. The members of the library are specified after the keyword is. Here we have three ML source files ( bar.sig, foo.sml, and helper.sml) as well as references to two external libraries ( $/basis.cm and $/smlnj-lib.cm). The entry $/basis.cm typically denotes the description file for the Standard ML Basis Library [RG99]; most programs will want to list it in their own description file(s). The other library in this example ( $/smlnj-lib.cm) is a library of data structures and algorithms that comes bundled with SML/NJ.


next up previous contents
Next: 2.3 Invoking CM Up: 2. The CM model Previous: 2.1 Basic philosophy   Contents
Matthias Blume
2001-07-19