load loads
the file named by filespec into the Lisp environment.
The manner in which a source file
is distinguished from a compiled file
is implementation-dependent.
If the file specification is not complete and both a source file and a compiled file exist which might match, then
which of those files load selects is implementation-dependent.
If filespec is a stream, load determines what kind of stream it is and loads directly from the stream. If filespec is a logical pathname, it is translated into a
physical pathname as if by calling
translate-logical-pathname.
load sequentially executes each form it encounters in the file named by filespec. If the file is a source
file and the implementation
chooses to perform implicit compilation,
load must recognize top level forms as described in Section 3.2.3.1 Processing of Top Level Forms and arrange for
each top level form to be executed
before beginning implicit compilation
of the next. (Note, however, that processing of eval-when
forms by load
is controlled by the :execute situation.)
If verbose is true, load prints a message in the form of a comment (i.e.,
with a leading semicolon) to standard output indicating what file is being loaded and other useful
information. If verbose is false, load does not print this information.
If print is true, load incrementally prints information to standard output showing the progress of
the loading process. For a source file,
this information might mean printing the values
yielded by each form in the file as soon as those values are returned. For a compiled file, what is printed might not
reflect precisely the contents of the source
file, but some information is generally printed. If print is false, load
does not print this information.
If the file named by filespec is successfully loaded, load returns true.
If the file does not exist, the specific action taken depends on if-does-not-exist:
if it is nil, load
returns nil; otherwise, load
signals an error.
The external-format specifies the external file format to be used when
opening the file (see the function open),
except that when the file named by filespec
is a compiled file, the external-format
is ignored. compile-file and load cooperate in an implementation-dependent way to
assure the preservation of the similarity
of characters referred to in the source file at the time the source file was processed by the file compiler under a given external file format, regardless of
the value of external-format at the time the compiled file is loaded.
load binds *readtable*
and *package* to the values they held before loading
the file.
*load-truename* is bound by load
to hold the truename of the pathname of the file being loaded.
*load-pathname* is bound by load
to hold a pathname that represents filespec
merged against the defaults. That is, (pathname (merge-pathnames filespec)).