HELP SAVELISP                                    John Williams, Sep 1990

This file documents the Lisp interface to the Poplog saved image
facility. For details of the underlying mechanisms, see REF * SYSTEM.


         CONTENTS - (Use <ENTER> g to access required sections)

  1   Making Saved Images
  2   Restoring Saved Images


-----------------------------------------------------------------------
1  Making Saved Images
-----------------------------------------------------------------------

Important Note:
 Before compiling any code that  is to form part  of a saved image,  the
 variable *making-saved-image* must be set  true. (Its initial value  is
 nil). Otherwise, certain data structures that should be writeable (e.g.
 adjustable or fill-pointed arrays) will not be when  the saved image is
 restored.


To create a saved image, use:

    (savelisp pathname &key :init :lock :share)

This function saves the current state of the entire Poplog Lisp system
in pathname, which by convention should end in ".psv". It then returns
nil. When the saved state is subsequently restored (see below), the
restored call of savelisp returns t.

An example:

    (if (savelisp "myimage")
        (format t "Restored~%")
        (format t "Saved~%"))

If :init is true, the function initlisp is called when the saved image
is restored. initlisp prints the standard `Sussex POPLOG Common Lisp'
message, and then loads initialisation files.

If :lock is true, the image is partitioned into writeable and
non-writeable portions. The parameter :share specifies whether the
non-writeable portion of the image will be mapped into shared memory
when the image is restored. Not all operating systems support shared
memory. Currently (Jan 1990), sharing is possible only in VMS and SunOS
4.0 onwards.


-----------------------------------------------------------------------
2  Restoring Saved Images
-----------------------------------------------------------------------

There are two ways of restoring a saved image: from the shell (DCL, on
VMS systems), or from Lisp, using the function restorelisp.

To restore a saved image from the shell, run Common Lisp with the image
name as a parameter, preceded by the character "+". For example:

    % clisp +myimage            (Unix)

or

    $ clisp +myimage            (VMS)

To restore a saved image from Lisp, use the function restorelisp, e.g.

        (restorelisp "myimage")

WARNING: the Lisp process that calls restorelisp is completely
overwritten by the restored Lisp process.

Note: in both cases, the default file extension for saved images,
".psv", will be added if necessary.


--- C.all/lisp/help/savelisp
--- Copyright University of Sussex 1990. All rights reserved.
