
2 Building Applications
mlbatch for this purpose. This script takes a series of unit names and produces object files from the unit sources. See the man page for mlbatch for more details.
However, you do not need to use mlbatch to compile files that are suitable for use outside the interactive environment. All files you compile in the interactive environment are compiled equivalently: every unit you compile down to an object file is compiled ready for execution outside the interactive environment. You can either pass it to the MLWorks runtime system with the mlpervasive script, or build it into a standalone executable file (see Section 2.6 on page 40).
But if you do want to execute applications you developed in the interactive environment outside the interactive environment, you must bear in mind that there are important differences between what we introduced in Section 1.5 as the batch context and the interactive context.
Recall that the interactive context is what is available to you in the interactive environment. We distinguish it from the batch context, which is what is available to a file being batch-compiled. The interactive and batch contexts both contain:
MLWorks.
General structure, and various top-level functions, exceptions, and types that the General structure defines. It is also built in to MLWorks at the top level.
Shell structure, which is a collection of functions and options connected with the MLWorks interactive environment. Like the MLWorks and General structures it is always available at the top level.
x to the value 5 counts as a modification of the interactive context: it introduces a new binding to the top level. You modify the interactive context similarly whenever you load units from source or object files.
Shell structure is not ephemeral, but since it relates to details of the interactive MLWorks environment -- like the value-printer settings, editor preferences, and how to start running the GUI -- it makes no sense to make it visible in the batch context.

Generated with Harlequin WebMaker