[cmucl-imp] PCL::*OPTIMIZE-GF-CALLS-P* bug when GF name is shadowed lexically

Raymond Toy toy.raymond at gmail.com
Thu Mar 4 13:52:53 CET 2010


On 2/18/10 8:49 PM, Madhu wrote:
> CMUCL does not correctly handle FLETs in DEFMETHOD bodies which use the
> same name as that of the generic function.
> An example might be:
>
> ; (setq pcl::*optimize-gf-calls-p* t)
> (defmethod foo (bar var) (format t "GENERICFOO ~S, ~S.%" bar var))
>
> (defclass fnarr ()())
>
> (defmethod foo ((bar fnarr) var)
>   (flet ((foo (&optional arg)
> 	   (foo var (class-of arg)))) ; gf FOO call
>     (foo bar))) ; local function FOO call
>
> ;; (incorrect) Error when evaluating 
> (foo (make-instance 'fnarr) t)
>
>
> Perhaps the immediate symptom can be treated in WALK-METHOD-LAMBDA as
> follows? -- Madhu
>   

I'm not familiar with PCL at all, but that looks reasonable.  I'll check
it in shortly.

Ray




More information about the cmucl-imp mailing list