Next: Thanks Up: Library Collections and MzLib Previous: Library Collections and MzLib

# MzLib Overview

The MzLib utilities and syntax are not built into MzScheme and they are not already present after the stand-alone version of MzScheme has started.

MzLib is distributed among several smaller libraries, and each smaller library can be separately loaded. The utilities provided by each library and the other libraries it requires are detailed in the next chapter.

The non-macro parts of MzLib are written using signed units (see section 7.2). These libraries can be used through a unit, or the unit can be invoked and opened to use the utilities as top-level definitions. Non-macro libraries have five requirable files:

- `(require-library "xs.ss")` loads the signature of the unit for library x.
- `(require-library "xu.ss")` loads x as a unit definition, automatically requiring `xs.ss` and `xr.ss`.
- `(require-library "xr.ss")` loads x as a unit value (without adding any top-level definitions); the `xs.ss` library must be already loaded.
- `(require-library "x.ss")` requires `xu.ss` and copies the unit's exports into the global environment.

Some libraries contain only macros, and therefore do not have the `xu.ss`, `xr.ss`, and `xs.ss` files.

Applications written in core Scheme will most likely use `(require-library "x.ss")`, while unit-based applications will use `(require-library "xs.ss")` and `(require-library-unit/sig "xr.ss")` (see section 15.2.20).

In all, MzLib contains the following requirable files:

- `awk.ss`
- `cmdline.ss`, `cmdlineu.ss`, `cmdliner.ss`, `cmdlines.ss`
- `compat.ss`, `compatu.ss`, `compatr.ss`, `compats.ss`
- `compile.ss`, `compileu.ss`, `compiler.ss`, `compiles.ss` [CORE]
- `core.ss`, `coreu.ss`, `corer.ss`, `cores.ss`
- `date.ss`, `dateu.ss`, `dater.ss`, `dates.ss`
- `deflate.ss`, `deflateu.ss`, `deflater.ss`, `deflates.ss`
- `defstru.ss` [CORE]
- `file.ss`, `fileu.ss`, `filer.ss`, `files.ss` [CORE]
- `functio.ss`, `functiou.ss`, `functior.ss`, `functios.ss` [CORE]
- `inflate.ss`, `inflateu.ss`, `inflater.ss`, `inflates.ss`
- `macro.ss` [CORE]
- `match.ss` [CORE]
- `math.ss`, `mathu.ss`, `mathr.ss`, `maths.ss` [CORE]
- `mzlib.ss`, `mzlibu.ss`, `mzlibr.ss`, `mzlibs.ss`
- `pconvert.ss`, `pconveru.ss`, `pconverr.ss`, `pchookr.ss`, `pconvers.ss`
- `pretty.ss`, `prettyu.ss`, `prettyr.ss`, `prettys.ss` [CORE]
- `refer.ss` [CORE]
- `restart.ss`, `restartu.ss`, `restartr.ss`, `restarts.ss`
- `shared.ss` [CORE]
- `spidey.ss` [CORE]
- `string.ss`, `stringu.ss`, `stringr.ss`, `strings.ss` [CORE]
- `synrule.ss`, `synrule.ss`
- `thread.ss`, `threadu.ss`, `threadr.ss`, `threads.ss` [CORE]
- `trace.ss`
- `traceld.ss`
- `transcr.ss`, `transcru.ss`, `transcrs.ss`, `transcrs.ss`

The `compatm.ss` library contains just the macro portion of `compat.ss`.

A set of libraries marked with [CORE] can be required at once by requiring `core.ss`, `coreu.ss`, `corer.ss`, or `cores.ss`. The `corem.ss` library requires only the macro-defining [CORE] libraries.

The set of all MzLib libraries can be required at once by requiring `mzlib.ss`, `mzlibu.ss`, `mzlibr.ss`, or `mzlibs.ss`. The `mzlibm.ss` library loads the macro-defining MzLib libraries.

For libraries without `xu.ss` files, `coreu.ss` and `mzlibu.ss` require `x.ss`.

- Thanks

Next: Thanks Up: Library Collections and MzLib Previous: Library Collections and MzLib