[slime-devel] Find Definitions
Terje Norderhaug
terje at in-progress.com
Fri Dec 18 19:32:11 UTC 2009
I have some concerns regarding #'swank:find-definitions-for-emacs,
which is documented to "Return a list ((DSPEC LOCATION) ...) of
definitions for NAME." MCLIDE uses this functionality for the button
on its Apropos dialog that opens the definition for a symbol in the
editor.
In slime-2009-12-18, #'swank:find-definitions-for-emacs gives a
significantly different result depending on the lisp implementation.
This leads to compatibility issues and complicates client side use of
the result. Evaluate:
(swank:find-definitions-for-emacs "swank::find-definitions")
Clozure Common Lisp 1.4-r13119 returns:
(("#'SWANK-BACKEND:FIND-DEFINITIONS" (:LOCATION (:FILE "/Volumes/
Mirror/Users/Terje/DEV/MCLIDE_DEV/MCLIDE 1.0b1-2/MCLIDE.app/Contents/
Resources/Slime/swank-backend.lisp") (:POSITION 28699) (:SNIPPET
"(definterface find-definitions (name)
"))))
LispWorks 5.1.0 returns:
(("(DEFUN SWANK-BACKEND:FIND-DEFINITIONS)" (:LOCATION (:FILE "/
Volumes/Mirror/Users/Terje/DEV/MCLIDE_DEV/MCLIDE 1.0b1-2/MCLIDE.app/
Contents/Resources/Slime/swank-lispworks.lisp") (:FUNCTION-NAME "FIND-
DEFINITIONS") NIL)) ("(DEFUN SWANK-BACKEND:FIND-
DEFINITIONS)" (:LOCATION (:FILE "/Volumes/Mirror/Users/Terje/DEV/
MCLIDE_DEV/MCLIDE 1.0b1-2/MCLIDE.app/Contents/Resources/Slime/swank-
backend.lisp") (:FUNCTION-NAME "FIND-DEFINITIONS") NIL)))
Of particular concern is the DSPEC, which Clozure returns as "#'SWANK-
BACKEND:FIND-DEFINITIONS" and LispWorks returns as "(DEFUN SWANK-
BACKEND:FIND-DEFINITIONS)". It would be helpful if the DSPEC
standardized on the same symbol to denote that the definition is for
a function, as in (FUNCTION SWANK-BACKEND:FIND-DEFINITIONS).
To facilitate client side use and flexibility in presentation, I also
suggest that the DSPEC is returned as a list instead of as a string,
with the type as a symbol and the function name encoded as a string,
as in (FUNCTION "SWANK-BACKEND:FIND-DEFINITIONS").
-- Terje Norderhaug
terje at in-progress.com
More information about the slime-devel
mailing list