From: <hat...@ya...> - 2004-04-26 22:04:04
|
--- Sam Steingold <sd...@gn...> a écrit : > > * Bruno Haible <oe...@py...t> [2004-04-26 > 21:22:16 +0200]: > > > > Sam wrote: > >> The new CLISP backquote implementation by Kaz > contains a subtle bug > >> which manifests itself by CLISP's inability to > compile > >> <mit-clx/input.lisp>. > > > > Can you please give a small testcase, a) for our > testsuite, b) because > > I was unable to understand what the code meant to > do ? > > I would not claim to understand the code either. > Part of the problem is that I have hard time reading > backquote form (and > they are also printed in the same backquote format!, > see appended patch > - what do you think?) > > OK, here is a test case: > > (progn > (eval > (let ((env 123) (get-code '(:a 12 :b 45))) > `(defun get-macro (display event-key variable) > `(let ((%buffer ,display)) > (declare (ignorable %buffer)) > ,(getf `(:display (the t ,display) > :event-key (the t ,event-key) > ,@',(mapcar #'(lambda (form) (list > form env)) > get-code)) > variable))))) > (compile get-macro) ; optional, CLISP errors out > (eval (get-macro 1234 5678 :display))) > ==> 1234 > > (get-macro 1234 5678 :display) should evaluate to > (LET ((%BUFFER 1234)) (DECLARE (IGNORABLE %BUFFER)) > (THE T 1234)) This example might be more easy to understand: (defmacro define-setf (var &rest values) `(defsetf ,(intern (symbol-name var)) () (value) `(setf ,',var (+ ,value ,@',values)))) Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com |