I am trying to get Emacs, SLIME and quicklisp to work together properly. I have the following environment set up:
(quicklisp-quickstart:install)
in SBCL(ql:add-to-init-file)
in SBCL(ql:quickload "quicklisp-slime-helper")
in SBCL(ql:quickload "cl-csv")
in SBCL(setq inferior-lisp-program "sbcl")
to .emacs(load (expand-file-name "~/quicklisp/slime-helper.el"))
to .emacsI have a test.lisp
file that starts with (ql:quickload "cl-csv")
to load the package and use it. When I load the file into Emacs and run SLIME, then try to compile it using slime-compile-and-load-file
, I get the error in SBCL that Package CL-CSV does not exist
.
What have I missed to get these pieces working together properly?
If you compile a file which contains a statement
(ql:quickload "cl-csv")
then this call will be compiled, but not executed. That's what a compiler usually does: it compiles, but does not execute. Thus if you use some Lisp package (a namespace) later in the same file - a package which would be introduced in the system cl-csv
- then it might not be present, if you have not loaded it before, by loading the system.
There are two typical solutions to this:
EVAL-WHEN
with :compile-toplevel
, :load-toplevel
and :execute
Note that cl-csv
is a system, organizing source files. A package is a Lisp namespace for organizing Lisp symbols. A package and a system can have the same name, but they really are two different things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With