2 Building Applications

2.4 Units and compounds

As has been hinted so far, the MLWorks compilation system thinks of source and object code being stored in units; source and object files are considered different forms of the same unit. Units in turn can be stored in compounds. Compounds can contain subcompounds.

Units and compounds are analogous to files and directories. In the above example, it was assumed that all source files were in the directory from which you invoked MLWorks, and the issue of compounds never came into question.

But suppose instead that zval.sml is in a subdirectory values of that directory. If you now choose File > Read Dependencies and select zval.sml in the file selection dialog, the corresponding unit shows up as values.zval. Because it has been placed in a subdirectory values of the top-level directory that all the other files are in, MLWorks considers the unit zval to be in a compound called values.

If xval, a top-level unit, still wants to require values.zval, the require statement must be changed:

Figure 2.7 New require statement for xval.sml.

Figure 2.8 Compilation manager showing unit values.zval.


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

Generated with Harlequin WebMaker