I am using SBCL 1.0.56 on Debian compression, with cl-swank / slime 1: 20120420-2 (Debian version number). These are all current versions unstable.
I'm having trouble downloading third-party CL packages. The documentation for using CL on Debian (and, indeed, the more general CL using Linux documentation) is sketchy, inconsistent, and deprecated, so I will summarize what I know. That is where I am.
Debian installs binary packages (e.g. cl-split-sequence) in /usr/share/common-lisp/source
. In the case of a split sequence, this is /usr/share/common-lisp/source/cl-split-sequence
.
The .asd file (here /usr/share/common-lisp/source/cl-split-sequence/split-sequence.asd
), which, as I understand it, gives instructions for implementing the CL about version and dependencies, looks like
;;; -*- Lisp -*- mode (defpackage #:split-sequence-system (:use #:cl #:asdf)) (in-package :split-sequence-system) (defsystem :split-sequence :version "20011114.1" :components ((:file "split-sequence")))
Now, when you run slime, enter the following two lines in the REPL works without problems
(require :split-sequence) (split-sequence:SPLIT-SEQUENCE
(require :split-sequence)
calls (I think) a built-in copy of ASDF inside SBCL, which apparently looks like split-sequence.asd
. This is probably SBCL specific, see General Lisp in the Debian Chapter 3 -Libraries Guide . It is worth noting that this page, which is as useful and detailed as everything I have seen, often refers to CLC (Common Lisp Controller), but it seems that Debian is moving away from this. See the Redesign of the Common Lisp Controller , which I donβt quite understand. Anyway, none of the documented commands for using CLC work for me. However, CLC is still available on Debian. In addition, the user mailing list is dead - see Users Clc Archives
On the first call (require :split-sequence)
it compiles, and (on my system, possibly Debian-specific) the resulting fasl
placed in
~/.cache/common-lisp/sbcl-1.0.56.0.debian-linux-x86/usr/share/common-lisp/source/cl-split-sequence/split-sequence.fasl
those. the file is placed under the cache in the file system, which mirrors the location of the source source. The obvious question is: how does the system know where to look for a package? This is one thing I'm not sure about. It looks like the search paths should be given in /etc/common-lisp/source-registry.conf.d
, which is part of Debian's ASDF, but the closest is 01-common-lisp-controller.conf
, which is just
(:directory #p"/usr/share/common-lisp/systems/")
It may be difficult somewhere, but I would like to know.
In any case, once this ASDF file is in the cache, it does not compile again, but the REPL does not see it after running the slime, unless require
again.
Now if i put the lines
(require :split-sequence) (split-sequence:SPLIT-SEQUENCE
In the file, say seq.lisp
, and load it into REPL with Cc Ck, I get an error and trace starting from
The name "SPLIT-SEQUENCE" does not designate any package. [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]
therefore, I came to the conclusion that the package was not loaded correctly. I tried options like
(asdf:oos 'asdf:load-op :split-sequence)
and
(asdf:load-system :split-sequence)
but not bones. Oddly enough, suppose we have a line
(require :split-sequence)
in the file - type require.lisp
for clarity. Then loading require.lisp
does not give an error and then it types
(split-sequence:SPLIT-SEQUENCE #\, "foo,bar")
works on REPL! However, without loading require.lisp
, typing the previous line does not work in REPL.
So in conclusion, how can a package be successfully loaded into a script? I am also interested in the problem mentioned above about how ASDF finds the location /usr/share/common-lisp/source/
, but this is more of a side issue.