I can (asdf:load-system :foo), but asdf still complains that '"foo" doesn't designate a package'

503 views Asked by At

Trying to finally start using asdf for my lisp doodles, I tried setting up a simple example. The files are

; contents of example.asd
(asdf:defsystem "example"
   :name "example"
   :depends-on ("foo")
   :components ((:file "example")))

and

; contents of example.lisp
(defpackage :example
   (:use :cl :asdf :foo))
(in-package :example)

(where "foo" is actually "cl-wav", but the problem persists with any of the packages I have installed locally).

Now, even though running

(asdf:load-system :foo)

works, when I try to evaluate

(asdf:make :example)

I get this error message:

The name "FOO" does not designate any package.

What am I doing wrong?

For context, my asdf-version is "3.1.5", the package "foo" is installed with (the latest version of) quicklisp, and all of this takes place in SBCL 1.3.20.

1

There are 1 answers

0
jkiiski On BEST ANSWER

ASDF systems are a different thing from packages. A system is simply a way to group a bunch of files together in a single application or a library, which can be easily compiled, loaded, tested or installed with Quicklisp. There may be multiple packages in a single system (or even none, although that would be strange). Usually libraries have a "main" package with the same name as the system, but that isn't mandatory.

In this case, the system cl-wav defines a package named WAV, so you need to use that in your package definition. It might have been better for the library author to name the package CL-WAV with WAV as a nickname, but they didn't do so.

(defpackage :example
  (:use :cl :asdf :wav))