我把它写在源缓冲区中:
(defun make-cd (artist album rating like)
(list :artist artist :album album :score rating :like like))
(defvar *dab* nil)
(defun addcd (cd) (push cd *dab*))
(defun readab ()
(dolist (cd *dab*)
(format t "~{~10t~a--~5t~a~%~}~%" cd)))
我通过按 Cc Ck 编译成 REPL。
前几个函数在 REPL 中运行良好:
CL-USER> (make-cd "dixie" "fun time" 6 "y")
(:ARTIST "dixie" :ALBUM "fun time" :SCORE 6 :LIKE "y")
CL-USER> (addcd (make-cd "dixie" "whooola" 6 "y"))
((:ARTIST "dixie" :ALBUM "whooola" :SCORE 6 :LIKE "y"))
但最后一个被报告为未定义?
CL-USER> (readab)
; Evaluation aborted on #<CCL::UNDEFINED-FUNCTION-CALL #x302000B3895D>.
我错过了一些非常明显的东西吗?