[slime-cvs] CVS update: slime/swank-sbcl.lisp

Helmut Eller heller at common-lisp.net
Wed Jul 28 21:07:20 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv10694

Modified Files:
	swank-sbcl.lisp 
Log Message:
(list-callers, list-callees): Implemented.
Date: Wed Jul 28 14:07:19 2004
Author: heller

Index: slime/swank-sbcl.lisp
diff -u slime/swank-sbcl.lisp:1.96 slime/swank-sbcl.lisp:1.97
--- slime/swank-sbcl.lisp:1.96	Mon Jul 19 17:42:14 2004
+++ slime/swank-sbcl.lisp	Wed Jul 28 14:07:18 2004
@@ -418,6 +418,20 @@
     (:type
      (describe (sb-kernel:values-specifier-type symbol)))))
 
+(defun function-dspec (fn)
+  "Describe where the function FN was defined.
+Return a list of the form (NAME LOCATION)."
+  (let ((name (sb-kernel:%fun-name fn)))
+    (list name (safe-function-source-location fn name))))
+
+(defimplementation list-callers (symbol)
+  (let ((fn (fdefinition symbol)))
+    (mapcar #'function-dspec (sb-introspect:find-function-callers fn))))
+
+(defimplementation list-callees (symbol)
+  (let ((fn (fdefinition symbol)))
+    (mapcar #'function-dspec (sb-introspect:find-function-callees fn))))
+
 ;;; macroexpansion
 
 (defimplementation macroexpand-all (form)





More information about the slime-cvs mailing list