3.5 Using the libraries in your applications: an example
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.
Generated with Harlequin WebMaker