+ Giannandrea Castaldi <[EMAIL PROTECTED]>:
| Hi,
| I have the following file
| home/gcast/lisp/cl-todo/src/test-suite.lisp and I want to load it
| using *load-pathname* but I haven't understood as use
| *load-pathname*. I thought that the following expressions were
| right:
|
| (setf *load-pathname* (pathname "/home/gcast/lisp/cl-todo/src/"))
| (load "test-suite.lisp")
| but I have an error that the file doesn't exists. Where is my mistake?
Your mistake is inverting the logic. LOAD sets *LOAD-PATHNAME* to the
name of the file it's loading; it is not a way to specify where load
should be looking for files.
The variable you're looking for is *default-pathname-defaults*.
However, if you already have the full pathname to your file it's just
as easy to do
(load "/home/gcast/lisp/cl-todo/src/test-suite")
directly. (I recommend leaving off the extension, so it will load the
fasl file instead if there is one. Include an extension only if you
have reason to avoid loading a fasl file.
| Another question: Is there in Ansi CL (or in cmucl) a way to
| mantains a list of pathname where to look for lisp files to load so
| that I can put it in my .cmucl-init?
CMUCL has search paths. Here is a snippet from my init file:
(setf (search-list "mylib:") '(#p"home:lib/lisp/" #p"home:src/lisp/"))
Then I can say, e.g., (load "src:asdf"). ("home:" is a predefined
search path with your home directory.)
For more details on using search paths, see the cmucl user manual.
See http://www.cons.org/cmucl/doc/index.html if for some reason you
don't have it.
- Harald