[slime-devel] Re: SBCL-specific function inspection

Helmut Eller heller at common-lisp.net
Tue Mar 4 11:47:37 UTC 2008


* Ariel Badichi [2008-03-03 05:17+0100] writes:

> The following patch is a work-around (excuse the pun) to have the
> fancy-inspector use the SBCL-specific method for function inspection.
>
> Ariel
>
> diff -u -r1.193 swank-sbcl.lisp
> --- swank-sbcl.lisp	28 Feb 2008 19:44:14 -0000	1.193
> +++ swank-sbcl.lisp	3 Mar 2008 04:09:39 -0000
> @@ -1041,7 +1041,7 @@
>                        (loop for value in parts  for i from 0
>                              append (label-value-line i value))))))))
>  
> -(defmethod emacs-inspect ((o function))
> +(defmethod emacs-inspect :around ((o function))
>    (let ((header (sb-kernel:widetag-of o)))
>      (cond ((= header sb-vm:simple-fun-header-widetag)
>                     (label-value-line*

My CLOS skills are pretty much not existent, perhaps somebody could
help me out on this.  Would it be bad style to do the following in the
fancy-inspector?

   (unless (find-method #'emacs-inspect nil '(function) nil)
     (defmethod emacs-inspect ((f function))
        ...))

I.e. define the method only if the backend didn't provide one.
Or can ADD-METHOD be used for this purpose?

Helmut.




More information about the slime-devel mailing list