Re: slime maybe-method-location
Alan Ruttenberg <[email protected]> Sun, 14 Aug 2005 00:35:54 -0400
| Newsgroups | gmane.lisp.openmcl.bugs |
|---|---|
| Message-ID | <[email protected]> |
Here's the story:
In order to find the location of a method by doing a text search, you
need to get enough information to reconstruct what the defmethod
would look like, given the method object. Otherwise you look for def*
<method name> which gives the behaviour Gary observes - wrong method
found more likely than not.
So you need to get the qualifiers and specializers and pass them on
to swank to construct a regexp from.
The initial version of this function looked like:
(defun maybe-method-location (type)
(when (typep type 'ccl::method)
`((method ,(ccl::method-name type)
,(ccl::method-specializers type)
,@(ccl::method-qualifiers type))
,(function-source-location (ccl::method-function type)))))
At some point Marco changed a bit of this to:
(mapcar #'specializer-name (ccl::method-specializers type))
(if Marco is reading this, do you remember why you made this change?)
and defined
(defun specializer-name (spec)
(etypecase spec
(cons spec)
((or swank-mop:standard-class built-in-class) (swank-mop:class-
name spec))
(swank-mop:eql-specializer `(eql ,(swank-mop:eql-specializer-
object spec)))))
This is buggy, since it doesn't cover all specializers.
At some later point I think I added structure-class to the typecase
to fix one case.
So this function is what needs to be fixed. (still haven't paged in
enough in to fix it. later)
-Alan
On Aug 13, 2005, at 5:51 PM, Gary Byers wrote:
>
>
> On Sat, 13 Aug 2005, bryan o'connor wrote:
>
>
>> the problems seem to arise from the call to
>> swank-backend::maybe-method-location. removing that
>> from find-definitions seems to work.
>>
>
> SWANK::MAYBE-METHOD-LOCATION calls SWANK::FUNCTION-SOURCE-LOCATION
> which calls CCL::EDIT-DEFINITION-P, which tries (in the DOCUMENTATION
> case) to call CLASS-NAME on an EQL specializer, and that signals
> an error.
>
>