Some new functions have been added to PolyML.SaveState to support
"modules". A module is a collection of bindings, primarily structures,
signatures and functors, that can be saved and later reloaded. It's
mainly aimed at those packaging up binary distributions since a module
can only be reloaded into the same binary that exported it, much as with
saved states.
PolyML.SavedState.savedModule takes a file name and names of structures,
signature and functors, together with an optional "on-start-up" function
and writes them out as a package. PolyML.SavedState.loadModule takes a
name and loads the module. When the module is loaded the "on-start-up"
function is executed and the structures, signatures and functors are
added to the top-level name space. The module name can either be a file
path if it contains a directory separator e.g. ./foo or it is looked up
in the path given by POLYMODPATH. There are lower level functions in
SavedState that can be used to include values, type constructors and
even infix bindings in a module and to import a module into a name space
other than the default top-level.
The idea is to provide a way for extensions to be packaged up for
Poly/ML. There are a number of features that it might be nice to
provide but aren't part of the core system. An example would be the
Windows GUI modules but I'm sure there are others. I hope it would also
encourage contributions.
David