Question

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")))
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top