
2.3 Using the MLWorks compilation system
.mo. The object file can later be loaded into the environment very quickly -- it is much faster than re-evaluating all the declarations in the file, for example. You can see this in action by compiling the unit xval, for which at present only a source file exists.
In the compilation manager, select xval in the list of units, and choose Build > Compile. The command is echoed in the lower pane of the compilation manager:
Compile xval Compiling /u/ldisk/markw/ml/zval.sml Compiling /u/ldisk/markw/ml/xval.smlNotice that, though you only asked for
xval to be compiled, MLWorks has compiled zval too, as xval depends on zval. MLWorks brings up a confirmation dialog when the compilation is finished. It has now created object files xval.mo and zval.mo in the same directory as the source files.
MLWorks only compiles those files that do not already have up-to-date object files. You can see this in action if you now compile sumxy, by choosing it from the list and choosing Build > Compile:
Compile sumxy Compiling /u/ldisk/markw/ml/yval.sml Compiling /u/ldisk/markw/ml/sumxy.smlMLWorks compiled
yval (on which sumxy depends), but did not re-compile xval and zval, as up-to-date object files already existed for those units. If the source files for the xval and zval units had been changed since they were last compiled, MLWorks would have recognized this and re-compiled them. For example, if you now choose Build > Query > Compile:
Check compile of sumxy No units need compilingThe Query submenu's Compile item does not actually try to compile the unit; it merely looks to see which non-existent or out-of-date object files would need to be generated if this file were compiled. None of the source files for
sumxy or the units it depends on have changed, so all the object files are still current. Now choose Build > Touch > Source. This changes the date stamp on the source file (as if the source had been edited), making the object file for sumxy look out of date. Choosing Build > Query > Compile again gives:
Check compile of sumxy Units to compile: sumxy
sumxy.mo is now out of date, but none of the other object files it depends on need re-compiling.The Build > Touch > Source menu item can be used to force re-compilation of a unit, even when the source file has not actually been changed.

Generated with Harlequin WebMaker