문제

I've followed the instructions here: http://xach.livejournal.com/278047.html and gotten them to work. I called the project test, so I have a test.lisp file that looks like :

;;;; test.lisp

(in-package #:test)

;;; "test" goes here. Hacks and glory await!

(defun foo ()
    (format t "hello from EMAIL-DB package~%"))

When I run (ql:quickload "test") I get: The variable FOO is unbound. If I comment out the (in-package #:test) line, then foo is no longer unbound when I load it. Which tells me that the function foo is syntactically ok.

What am I doing wrong? Why is foo unbound when use (ql:quickload "test')?

Here's my package file:

;;;; package.lisp

(defpackage #:test
  (:use #:hunchentoot))

And my test.asd file:

;;;; test.asd

(asdf:defsystem #:test
  :serial t
  :depends-on (#:hunchentoot
               #:cl-who
               #:postmodern)
  :components ((:file "package")
               (:file "test")))
도움이 되었습니까?

해결책

Your test package doesn't use the CL package, so your DEFUN is TEST::DEFUN (not CL:DEFUN). There's no macro definition for TEST::DEFUN, so the system proceeds to evaluate using the function call rules, which are to evaluate each subform in order, then apply the function to the values of the arguments. The first subform is TEST::FOO, which is a lookup of a variable -- and there is no such variable as TEST::FOO in your image.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top