From gwking at metabang.com Wed Nov 26 01:13:38 2008 From: gwking at metabang.com (Gary King) Date: Tue, 25 Nov 2008 20:13:38 -0500 Subject: [Metatilities-devel] One more bug In-Reply-To: <4be8713d0811251651i4571fe52h751868899cf918@mail.gmail.com> References: <4be8713d0811251651i4571fe52h751868899cf918@mail.gmail.com> Message-ID: <8C87BD2A-4364-40DD-95F7-34733DB98B50@metabang.com> 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) > # > 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) , at 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: