previous up next     contents index
Next: Index Up: MzScheme Reference Manual Previous: Miscellaneous Extensions

MzLib Library

 

   

MzScheme is distributed with a library of utility functions. The library files are usually installed in a ``mzlib'' directory that is in the same directory is the MzScheme executable. The stand-alone MzScheme executable finds the library directory automatically if it is in the search path (see below); otherwise, the library pathname must be set explicitly using (current-library-path path). The current library path is returned by (current-library-path). (If the library path is unknown, (current-library-path) returns #f.)

The stand-alone MzScheme executable sets the library pathname by trying these expressions (in the order listed here) until it finds a directory that exists:

The library pathname is used by  require-library. This procedure takes a filename (e.g., "pretty.ss") and loads the library file by that name. If the file has already been loaded, it is not loaded again. The require-library procedure also accepts pathnames (absolute or relative to the current library directory); the load state of the file is keyed on the pathname as provided, so loading the same file with two different equivalent pathnames will load the file twice.

The current-library-path and require-library procedures are normally used for MzLib. However, these procedures may be used with a different library, especially if MzScheme is embedded within another application. (MrEd uses require-library to load MzLib files.)

The complete MzLib library is described in MzLib Reference Manual.



PLT