1.0.32.38: liberalize WHO-SPECIALIZES-DIRECTLY/GENERALLY
authortrittweiler <trittweiler>
Tue, 24 Nov 2009 16:31:19 +0000 (16:31 +0000)
committertrittweiler <trittweiler>
Tue, 24 Nov 2009 16:31:19 +0000 (16:31 +0000)
Other Xref functions (WHO-CALLS etc.) are very liberal at what they
accept as input. Adjust the two new Xref functions
WHO-SPECIALIZES-DIRECTLY and WHO-SEPCIALIZES-GENERALLY accordingly.

contrib/sb-introspect/introspect.lisp
version.lisp-expr

index ff854a6..f031284 100644 (file)
@@ -639,6 +639,8 @@ designated class.
 Experimental.
 "
   (let ((class (canonicalize-class-designator class-designator)))
+    (unless class
+      (return-from who-specializes-directly nil))
     (let ((result (collect-specializing-methods
                    #'(lambda (specl)
                        ;; Does SPECL specialize on CLASS directly?
@@ -670,6 +672,8 @@ designated class or a subclass of it.
 Experimental.
 "
   (let ((class (canonicalize-class-designator class-designator)))
+    (unless class
+      (return-from who-specializes-generally nil))
     (let ((result (collect-specializing-methods
                    #'(lambda (specl)
                        ;; Does SPECL specialize on CLASS or a subclass
@@ -689,9 +693,10 @@ Experimental.
                 result))))
 
 (defun canonicalize-class-designator (class-designator)
-  (etypecase class-designator
-    (symbol (find-class class-designator))
-    (class  class-designator)))
+  (typecase class-designator
+    (symbol (find-class class-designator nil))
+    (class  class-designator)
+    (t nil)))
 
 (defun method-generic-function-name (method)
   (sb-mop:generic-function-name (sb-mop:method-generic-function method)))
index 559e367..5d28905 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.32.37"
+"1.0.32.38"