[EMAIL PROTECTED] writes:
 > 
 > Christophe Rhodes writes:
 >  > On Mon, Dec 09, 2002 at 12:35:17PM -0600, [EMAIL PROTECTED] wrote:
 >  > > I've been getting some cryptic error messages from the following block
 >  > > of code with CMUCL 18d
 >  > > 
 >  > > (in-package "COMMON-LISP-USER")
 >  > > 
 >  > > (defmacro setassoc (key new-element alist &key (test #'eq))
 >  >                                                  ^^^^^^^^^^^
 >  > 
 >  > Here's your problem -- using this you'll try to dump the literal
 >  > function object to file, rather than a reference to a function.  You
 >  > want (test '#'eq) there instead.
 > 
 > Thanks.  I've made the change and that seems fine.  But I was
 > wondering if anyone could clarify for me why this happens in macros
 > and does not happen when I use #'eq in function definitions?
 > 
 > The same file has several functions that have #'eq as an argument, but
 > they work fine.  

Because the definition of those functions contain the source form
(function eq), not the literal function object #<Function EQ {10007891}>.
The macro looks up the EQ function at compile-time, then tries to use
that literal object in the source, which you can't dump in the FASL
file.  If the macro expands into a run-time lookup of the EQ function,
it's all gravy.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               

Reply via email to