Hi Gustavo

Thanks for the detailed report. I haven't looked at (or even used!) this code for a _long_ time so it wouldn't surprise me if its broken. I'll see what I can do over the Thanksgiving break.

regards,

On Nov 25, 2008, at 7:51 PM, Gustavo wrote:

The compiler macros for functions disjoin and conjoin are broken. For debugging purposes, I copied the code to a macro to see what was happening.

cl-user> (in-package :metatilities)
#<package "METABANG.UTILITIES">
utilities> (defmacro disjoin* (&whole form &rest fns)
  (cond ((every #'(lambda (x) (or (symbolp x) (function-expression-p x))) fns)
         (with-unique-names (args)
           `#'(lambda (,args)
                (or ,@(mapcar #'(lambda (x)
                                  `(apply ,(extract-head-form x)
                                          ,args))
                              fns)))))
        (t form)))
disjoin*
utilities> (macroexpand-1 '(disjoin* #'macro-char-p #'whitespace-p))
#'(lambda (#:|args/1399|)
    (or (apply macro-char-p #:|args/1399|) (apply whitespace-p #:|args/1399|)))
t

I realized this bug trying to compile a function - sbcl complained about the variables macro-char-p and whitespace-p not to be defined. That makes me wonder: what is "extract-head-form" doing? It should be usefull only if you did something like:

(define-compiler-macro disjoin (fn &rest fns)
  ...
    `(,(extract-head-form x) ,@args)
  ...
)

I.e., eliminating the funcalls (I saw that somewhere on cliki.net some time ago).And, by the way, I guess that, the way the function disjoin is being defined, I guess there is no way to do this (the argument list is only known in execution time).

--
Gary Warren King, metabang.com 
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM