2

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.

BlenderBender
  • 524
  • 3
  • 17
  • 3
    The name of the system is not necessary the same as the name of any package in the system. The system `cl-wav` has a package named `WAV`, so you need to use `(:use :wav ...)` to use it. – jkiiski Sep 09 '17 at 14:01
  • You were right, that solved it! I still don't know why it didn't work with "zpng" instead of "cl-wav" when I tried this earlier; it now works with "zpng" too. Must have missed something. – BlenderBender Sep 09 '17 at 14:09
  • 1
    Please make an answer, @jkiiski – Svante Sep 09 '17 at 20:03

1 Answers1

2

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))
jkiiski
  • 8,206
  • 2
  • 28
  • 44