From: Stas B. <sta...@gm...> - 2013-10-30 20:10:34
|
Nikodemus Siivola <nik...@ra...> writes: > On 29 October 2013 18:32, Attila Lendvai <att...@gm...> wrote: > >> it was the right question, because to answer you i started to dig >> deeper and found the bug. it's an incorrect assumption that the whole >> make-method-lambda stuff only gets called from defmethod expansions, >> and it's never nested. > > Nice detective work! Armed with this, do you think you could extract a > test case? (Non-minimal is fine, just as long as it is > self-contained.) I can think of a really convoluted way to get a clash: (defmethod b ()) (defparameter *method-lambda* nil) (defmacro macro () (unless *method-lambda* (setf *method-lambda* (sb-mop:make-method-lambda #'b (find-method #'b () ()) '(lambda ()) nil)))) (defmethod a (a b c) (macro)) *method-lambda* will be (LAMBDA (SB-PCL::.METHOD-ARGS. SB-PCL::.NEXT-METHODS.) (SB-PCL::SIMPLE-LEXICAL-METHOD-FUNCTIONS ((A B C) SB-PCL::.METHOD-ARGS. SB-PCL::.NEXT-METHODS. :CALL-NEXT-METHOD-P NIL :NEXT-METHOD-P-P NIL :SETQ-P NIL :PARAMETERS-SETQD NIL :METHOD-CELL (#:METHOD-CELL) :CLOSUREP NIL :APPLYP NIL) (DECLARE (IGNORABLE A B C)) (DECLARE (TYPE T A) (TYPE T B) (TYPE T C)) (LOCALLY (DECLARE (DISABLE-PACKAGE-LOCKS SB-PCL::%PARAMETER-BINDING-MODIFIED)) (SYMBOL-MACROLET ((SB-PCL::%PARAMETER-BINDING-MODIFIED (QUOTE))) (DECLARE (ENABLE-PACKAGE-LOCKS SB-PCL::%PARAMETER-BINDING-MODIFIED)) (BLOCK A))))) -- With best regards, Stas. |