Quoting your text from above (to make it easier to understand), here is what I did to find out what the problem is:
I copied the files from chapter 3 ('chapter-3.asd', 'packages.lisp', 'simple-database.asd' and 'simple-database.lisp') in my quicklisp local-projects directory.
Then at the SLIME REPL:
Code: Select all
CL-USER> (ql:quickload :simple-database)
To load "simple-database":
Load 1 ASDF system:
simple-database
; Loading "simple-database"
[package com.gigamonkeys.simple-db]
(:SIMPLE-DATABASE)
CL-USER>
To use the functions from the
com.gigamonkeys.simple-db package I need to change from the cl-user package to the com.gigamonkeys.simple-db package by typing:
Code: Select all
CL-USER> (in-package :com.gigamonkeys.simple-db)
#<PACKAGE "COM.GIGAMONKEYS.SIMPLE-DB">
SIMPLE-DB>
The SLIME prompt changes from CL-USER> to SIMPLE-DB>.
Now I can use the database functions from PCL:
Code: Select all
SIMPLE-DB> (make-cd "Roses" "Kathy Mattea" 7 t)
(:TITLE "Roses" :ARTIST "Kathy Mattea" :RATING 7 :RIPPED T)
SIMPLE-DB>
To change back to the cl-user package I type:
Code: Select all
SIMPLE-DB> (in-package :cl-user)
#<PACKAGE "COMMON-LISP-USER">
CL-USER>
Packages are explained later in PCL Chapter 21,
Programming in the Large: Packages and Symbols (don't read this now because it's advanced stuff).
The code in the book shows the CL-USER> prompt because all functions are defined interactively at the CL-USER> prompt (and therefore are interned in the cl-user package), but if you use the example code you need to change to te respective package that is printed after quicklisp has loaded the files.
Have fun with Common Lisp!
- edgar