3 Using the MLWorks Libraries

3.3 How the libraries are distributed

As we saw in Chapter 2, in the compilation system we can consider source and object files to be units and the directories containing them compounds. All library units are stored in appropriately named compounds in the installation. For instance, the MLWorks foreign interface library is stored in the compound (directory) foreign, and Standard ML Basis library units are stored under basis.

Each unit in an MLWorks library contains either a structure, a functor, or a signature. The unit names are based on the names of the structure, functor, or signature that they contain. The prefix of the unit name indicates which of the three kinds of SML module it contains:

Structure
__ (two underscores)

Functor
_ (one underscore)

Signature
no prefix

The rest of the unit name is the name of the structure, functor or signature, converted to lower case, with word breaks indicated by underscores. For example:

signature LIST_UTILS becomes list_utils.mo

structure ListUtils becomes __list_utils.mo

Beware of swapping singular for plural (or vice versa).

Some units contain signatures or structures that are sub-components of other signatures or structures. In these cases, any "." separators in the SML identifier are replaced by single underscores. For example:

structure OS.Process becomes __os_process.mo

The object-file versions of units have the usual extension .mo, and the source versions (if any) have the extension .sml. Typically, structures and functors are distributed in object-file form only, and signatures are distributed in both source-file and object-file form. The availability of the signature in source form permits you to use the structure or functor it defines, or indeed to extend the library by writing new structures and functors using the signature.

(This distribution method is similar to the way C programming libraries are often distributed: "implementation" files (.c) are usually only distributed in compiled form (.o or .so), but header files (.h), which specify the interface to the library, are distributed in source form. However, in MLWorks the "header" files are distributed in object form as well.)

The image files for the libraries, which contain pre-loaded versions of the compiled units, are stored in the directory images.

The following is a complete list of compounds (subdirectories of the top-level installation directory):

basis
Compound for most Standard ML Basis library units.

foreign
Compound for MLWorks Foreign Interface library units.

motif
Compound for MLWorks Motif interface library units.

pervasive
Compound for MLWorks pervasive library (MLWorks structure) units and the Standard ML Basis library's General structure, both of which are necessary to run all code compiled with MLWorks. The General structure is also available in basis.

system
Compound for some system-specific Standard ML Basis library units.

utils
Compound for some Standard ML Basis library units.

unix
The system compound is a link to this.

The following is a complete list of library images:

basis.img
An image of the Standard ML Basis library.

foreign.img
An image of the MLWorks Foreign Interface library.

pervasive.img
An image of the MLWorks pervasive library.

xm.img
An image of the MLWorks Motif interface library

Note: This is not the complete list of images, just that of library images: there are also images for the batch compiler and the MLWorks interactive environment itself. The batch compiler image is batch.img. The interactive environment with the pervasive library (MLWorks), the Standard ML Basis library's General structure, and the interactive environment library (Shell) is gui.img, and a copy of the interactive environment including the entire Standard ML Basis library is guib.img.


MLWorks User Guide (UNIX version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker