Practical CL ch3 error
Posted: Wed May 20, 2009 2:39 pm
Hi,
I've just begun to learn Lisp, and have been coding in C/C++ and PHP for a few years. I'm running Clisp in Debian GNU/Linux (x86_64) and am working through the book "Practical Common Lisp"...
I copy the function from page 31:
into a file, and then load it like so:
and just don't have a clue what is wrong there. Seeing as I'm still at chapter 3, very little has sunk in yet
But I've heard I need to be patient. Any ideas as to what's wrong here?
TIA.
I've just begun to learn Lisp, and have been coding in C/C++ and PHP for a few years. I'm running Clisp in Debian GNU/Linux (x86_64) and am working through the book "Practical Common Lisp"...
I copy the function from page 31:
Code: Select all
(defun update (selector-fn &key title artist rating (ripped nil ripped p))
(setf *db*
(mapcar
#'(lambda (row)
(when (funcall selector-fn row)
(if title (setf (getf row :title) title))
(if artist (setf (getf row :artist) artist))
(if rating (setf (getf row :rating) rating))
(if ripped-p(setf (getf row :ripped) ripped)))
row) *db*)))
Code: Select all
james@scrapyard:~/Lisp$ clisp -repl cd_db.lsp
*** - DEFUN: Invalid lambda list element (RIPPED NIL RIPPED P)
The following restarts are available:
SKIP :R1 skip (DEFUN UPDATE # ...)
STOP :R2 stop loading file /home/james/Lisp/cd_db.lsp
Break 1 [6]>

TIA.