I'm using quicklisp as the package management tool for SBCL.
However, sometimes I found it's not very convenient to install a package to the HOME directory of current user by ql:quickload
. (For example, if I use (ql:quickload "xmls")
to install xmls, other users can't use it.)
What's worse, I'd like to run the lisp code as a script. So when I use the package installed by quicklisp, I need to add the absolute path of that package uncomfortably, such as:
#!/usr/bin/sbcl --script
(require 'xmls "..../quicklisp/dists/quicklisp/software/xmls-1.4/xmls")
If I use (require 'xmls)
, the compiler will not work because it cannot find that package if I use the --script
options.
Does anyone knows how to solve the problem so that I can use --script
and require
(no need to add absolute path) at the same time?
I don't know of a good solution to this problem. The solution I use is to not write scripts with Common Lisp; I usually write applications that I use interactively from CL sessions. When I do want to run things from the command-line, I use buildapp for it, and use ql:write-asdf-manifest-file
to create a file to pass to --manifest-file
for buildapp.
I sometimes wish there was a better solution, but it'll probably take some work by someone (hopefully not me).