### 1.4 Catalog Creation ¶

At the start of an interactive session no catalog is present, but is created with the first catalog inquiry (such as `(require 'random)`). Several sources of catalog information are combined to produce the catalog:

- standard SLIB packages.
- additional packages of interest to this site.
- packages specifically for the variety of Scheme which this session is running. This catalog, if it exists, is the file `implcat` in `implementation-invicinity`, which is created by loading `mkimpcat.scm` in `implementation-invicinity` if it exists.
- packages this user wants to always have available. This catalog is the file `homecat` in the user’s HOME directory.
- packages germane to working in this (current working) directory. This catalog is the file `usercat` in the directory to which it applies. One would typically `cd` to this directory before starting the Scheme session.
- packages which are part of an application program.

SLIB combines the catalog information which doesn’t vary per user into the file `slibcat` in the implementation-vicinity. Therefore `slibcat` needs change only when new software is installed or compiled. Because the actual pathnames of files can differ from installation to installation, SLIB builds a separate catalog for each implementation it is used with.

The definition of `*slib-version*` in SLIB file `require.scm` is checked against the catalog association of `*slib-version*` to ascertain when versions have changed. It is a reasonable practice to change the definition of `*slib-version*` whenever the library is changed. If multiple implementations of Scheme use SLIB, remember that recompiling one `slibcat` will update only that implementation’s catalog.

The compilation scripts of Scheme implementations which work with SLIB can automatically trigger catalog compilation by deleting `slibcat` or by invoking `require` of a special feature:

Procedure: require ’new-catalog ¶

  This will load `mklibcat`, which compiles and writes a new `slibcat`.

Another special feature of `require` erases SLIB’s catalog, forcing it to be reloaded the next time the catalog is queried.

Procedure: require #f ¶

  Removes SLIB’s catalog information. This should be done before saving an executable image so that, when restored, its catalog will be loaded afresh.