3.5 Using the libraries in your applications: an example

3.5.2 Requiring TextIO and String in the application sources

The application sources must require the TextIO and String structures. Suppose the application is contained by a single file, app.sml. All we need to do is to add the following require declarations to the start of app.sml. They tell the compiler that the file depends on the TextIO and String structures; the compiled units for those structures in turn explain their own dependencies.

require "basis.__text_io";
require "basis.__string";

Now, when you read app.sml into a version of MLWorks without the Basis library loaded, its dependencies will be apparent and MLWorks will know how to satisfy them during compilation.


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

Generated with Harlequin WebMaker