Macro call function inside Quicklisp package

I put failing.asd

(in-package :asdf-user)                    

(defsystem "failing"                       
  :description "some code destined to fail"
  :version "0.1"                           
  :author "me"                      
  :components ((:file "package")))         

and package.lisp

(defpackage :failing  
  (:export :foo :bar))

(in-package :failing) 

(defun foo () 42)     

(defmacro bar ()      
  (let ((x (foo)))    
    `(print ,x)))     

(bar)                 

in ~ / quicklisp / local-projects / failing . Using Clozure CL with Quicklisp, I run

(ql:quickload :failing)

which gives me

To load "failing":
  Load 1 ASDF system:
    failing
; Loading "failing"
[package failing]
> Error: Undefined function FOO called with arguments () .
> While executing: BAR, in process listener(1).
> Type :GO to continue, :POP to abort, :R for a list of available restarts.
> If continued: Retry applying FOO to NIL.
> Type :? for other options.

It seems I can not call the function from the macro inside the package. Why not?

+5
source share
1 answer

, . , ASDF ( / ) ( ASDF).

, Common Lisp:

foo → . (!) .

→ . (!) .

(bar) . bar. foo, undefined, .

  • ASDF / .

  • (EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) ...) . , .

: → . , .

+6

All Articles