Re: PCL::*OPTIMIZE-GF-CALLS-P* bug when GF name is shadowed lexically

Raymond Toy <[email protected]>
Newsgroups gmane.lisp.cmucl.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.