I'm having trouble when I'm attempting to use macrolet.  I've made a very small 
test case to illustrate the problem.  First here's my CMUCL info (I'll note 
that I'm running on Debian Sarge):

CMU Common Lisp 19c (19C), running on operon
With core: /usr/local/lib/cmucl/lib/lisp.core
Dumped on: Thu, 2005-11-17 06:12:58-08:00 on lorien
See <http://www.cons.org/cmucl/> for support information.
Loaded subsystems:
    Python 1.1, target Intel x86
    CLOS based on Gerd's PCL 2004/04/14 03:32:47

Here's the failure case, note that I'm using a comma-at expansion of "z":

* (defun foo2 (x)
  (princ (format nil "listp(x) returns ~A." (listp x)))
  (macrolet ((fudge (z)
                    `(list 1 2 3 ,@z)))
            (fudge x)))

FOO2

When foo2 is run, I get this error:

* (foo2 '(1 2 3 4 a))

Type-error in KERNEL::OBJECT-NOT-LIST-ERROR-HANDLER:  X is not of type LIST
   [Condition of type TYPE-ERROR]

Restarts:
  0: [ABORT] Return to Top-Level.

Debug  (type H for help)

(C::DYNAMIC-EXTENT-CLOSURE-ARGS (1 2 3 . X))
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer 
exists:  target:compiler/ir1tran.lisp.
0] 0

If I change the comma-at to just just comma, look what happens:

* (defun foo2 (x)
  (princ (format nil "listp(x) returns ~A." (listp x)))
  (macrolet ((fudge (z)
                    `(list 1 2 3 ,z)))
            (fudge x)))

FOO2
* (foo2 '(2 4 5 a))
listp(x) returns T.
(1 2 3 (2 4 5 A))

I don't understand why lisp doesn't believe x is a list--it is clearly a list.  
Is this a bug or am I not using macrolet correctly?

--Andrew


Reply via email to