From dherring at tentpost.com Thu Aug 27 06:51:44 2009 From: dherring at tentpost.com (Daniel Herring) Date: Thu, 27 Aug 2009 02:51:44 -0400 (EDT) Subject: [Metabang-bind-devel] metabang-bind/clisp breakage Message-ID: [also posted to comp.lang.lisp] Metabang-bind used to work with clisp; but I can't get bind version 0.7.4 to work with clisp versions 2.47 or 2.48. Bind 0.7.4 does work for me with current CCL, ECL, and SBCL. The offending change was apparently made in a significant bind rewrite on 2009-03-01 with commit message "complete refactoring and macroizing". This problem was found in cl-markdown with forms like (bind (((:struct markup- name inner outer encoding-method) markup)) (format stream "~a : ~a ~a ~a" name outer inner encoding-method)) Clisp fails to macroexpand this, giving messages like FUNCALL: undefined function #1=#:|binding-generator6558| [Condition of type SYSTEM::SIMPLE-UNDEFINED-FUNCTION] In fact, clisp appears to fail on all bind forms that were defined with alternative values (such as :struct/:structure, :plist/:properties, ...). Bind forms are described in bind/dev/bindings.lisp. They are defined using the DEFBINDING-FORM macro (bind/dev/macros.lisp); it specializes the generic function BIND-GENERATE-BINDINGS for each key. Bindings with a single key are implemented directly in the specialization. Bindings with multiple keys are given one specialization per key, each calling a shared generic function named (gensym "binding-generator"). For some reason, clisp can't find the functions named by this gensym. I've tried adding a defgeneric for it, changing from a generic function to a plain function, and rearranging the code to define the function before the B-G-B that calls it. Nothing seems to work. Any ideas? I'm tempted to call this a clisp bug; but it is odd code. Thanks, Daniel From dherring at tentpost.com Fri Aug 28 05:44:51 2009 From: dherring at tentpost.com (Daniel Herring) Date: Fri, 28 Aug 2009 01:44:51 -0400 (EDT) Subject: [Metabang-bind-devel] metabang-bind/clisp breakage In-Reply-To: References: Message-ID: On Thu, 27 Aug 2009, Daniel Herring wrote: > Metabang-bind used to work with clisp; but I can't get bind version 0.7.4 > to work with clisp versions 2.47 or 2.48. Bind 0.7.4 does work for me > with current CCL, ECL, and SBCL. The offending change was apparently made > in a significant bind rewrite on 2009-03-01 with commit message "complete > refactoring and macroizing". > > This problem was found in cl-markdown with forms like > (bind (((:struct markup- name inner outer encoding-method) markup)) > (format stream "~a : ~a ~a ~a" > name outer inner encoding-method)) > > Clisp fails to macroexpand this, giving messages like > FUNCALL: undefined function #1=#:|binding-generator6558| > [Condition of type SYSTEM::SIMPLE-UNDEFINED-FUNCTION] ... The attached patch resolves the problem and gives some explanation of its cause. - Daniel -------------- next part -------------- From 499bca0937d1a35c6e14e15a6db69769db32ca81 Mon Sep 17 00:00:00 2001 From: D Herring Date: Fri, 28 Aug 2009 00:17:37 -0400 Subject: [PATCH] Work around a clisp bug. Clisp has trouble passing gensyms between forms created by a macro. see e.g. http://sourceforge.net/tracker/index.php?func=detail&aid=836838&group_id=1355&atid=101355 This mangling should be unique for each name/s. --- dev/macros.lisp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dev/macros.lisp b/dev/macros.lisp index 2dd8424..7c07315 100644 --- a/dev/macros.lisp +++ b/dev/macros.lisp @@ -54,7 +54,8 @@ instead #+(or) (gignores (gensym "ignores"))) (cond (multiple-names? - (setf main-method-name (gensym "binding-generator")) + (setf main-method-name + (intern (format nil "~A_~A" 'bind-generate-bindings (car name/s)))) ) (t (setf main-method-name 'bind-generate-bindings) -- 1.6.0.2