load

(load filename [error_expression])

The load function loads an existing Lisp file filename from disk, thus providing the functions defined in that file.

Expressions within the file that are outside of "defuns" are evaluated immediately.

The optional argument error_expression is an expression that is evaluated if loading fails. It can be an error message or a function.

Return Value

If the given file cannot be loaded, the function returns nil; otherwise, the function returns the result of the last expression evaluated.

Examples

: (load "test.lsp")

: (load "c:\\mylisp\\test.lsp")

: (load "test.lsp" "Cannot load TEST.LSP!")

: (load "test.lsp" (errorfunc))