All Manuals > LispWorks® User Guide and Reference Manual > 38 The LISPWORKS Package

load-system Function


Loads each file of a system into the Lisp image if either the file has not been loaded, or the file has been written since it was last loaded.




load-system system-name &key force simulate source-only target-directory => nil

A symbol or string.
A generalized boolean.
One of nil, t, :ask or :each.
A generalized boolean.
A pathname designator or nil.

The function load-system ensures that all the files in a system have been loaded.

system-name must be a symbol or string representing the name of the system. The system must have been defined already using the defsystem macro.

If force is non-nil then all the files in the system are compiled regardless. (This argument was formerly called force-p. The old name is currently still accepted for compatibility.). Otherwise only files that need it are compiled.

If simulate is nil (the default) then load-system works silently. Otherwise a plan of the actions which load-system intends to carry out is printed. What happens next depends on the value of simulate:

Do nothing.
You are asked if you wish the plan to be carried out using y-or-n-p.
load-system displays each action in the plan one at a time, and asks you whether you want to carry out this particular action. The answer c executes the rest of the plan without further prompting, e returns from load-system without further processing, and y and n work as expected. :simulate may be abbreviated as :sim.

If source-only is non-nil, the source files of the system are loaded. This only applies to file types where it makes sense to load a source file.

If target-directory is non-nil, it must be a pathname designator representing a valid directory. It defaults to the :default-pathname option to defsystem. This is the directory to search the object files. If the object file cannot be found here then the source file from the system's default directory are loaded.

(load-system 'blackboard)
(load-system 'tms :simulate :ask :source-only t)

For Lisp files load-system loads the object file (if it exists) into the image, unless over-ridden by the :source-only keyword argument. This behavior can be changed so that the newest file (whether source or object) is loaded by setting the variable *load-source-if-newer* to t.

C source files, for example foo.c, can be included in a system (see the use of :default-type and :type in defsystem). The corresponding object file name is on Linux, FreeBSD and x86/x64 Solaris and foon.dylib on macOS, where n is a platform-specific integer. On Windows the object file name is foo.dll.

See also


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:41