X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fdescribe.lisp;h=6efcba569e8753c5cef85f13ad81a535c40ffd1a;hb=104ee7ee303efa16e415f5e75df635ac54dba733;hp=998d45c79dd469dc6b145e90c9093d8f3f6dcdf9;hpb=59f7d9254f3601cfd48f0c299d5c30562111e991;p=sbcl.git diff --git a/src/pcl/describe.lisp b/src/pcl/describe.lisp index 998d45c..6efcba5 100644 --- a/src/pcl/describe.lisp +++ b/src/pcl/describe.lisp @@ -88,17 +88,22 @@ (defvar *describe-metaobjects-as-objects-p* nil) (defmethod describe-object ((fun standard-generic-function) stream) - (format stream "~A is a generic function.~%" fun) + (format stream "~&~A is a generic function.~%" fun) (format stream "Its arguments are:~% ~S~%" (generic-function-pretty-arglist fun)) - (format stream "Its methods are:") - (dolist (method (generic-function-methods fun)) - (format stream "~2% ~{~S ~}~:S =>~%" - (method-qualifiers method) - (unparse-specializers method)) - (describe-object (or (method-fast-function method) - (method-function method)) - stream)) + (let ((methods (generic-function-methods fun))) + (if (null methods) + (format stream "It has no methods.~%") + (let ((gf-name (generic-function-name fun))) + (format stream "Its methods are:") + (dolist (method methods) + (format stream "~2% (~A ~{~S ~}~:S) =>~%" + gf-name + (method-qualifiers method) + (unparse-specializers method)) + (describe-object (or (method-fast-function method) + (method-function method)) + stream))))) (when *describe-metaobjects-as-objects-p* (call-next-method))) @@ -115,7 +120,7 @@ (ft "It has no name (the name is NIL).~%"))) (ft "The direct superclasses are: ~:S, and the direct~%~ subclasses are: ~:S. The class precedence list is:~%~S~%~ - There are ~D methods specialized for this class." + There are ~W methods specialized for this class." (mapcar #'pretty-class (class-direct-superclasses class)) (mapcar #'pretty-class (class-direct-subclasses class)) (mapcar #'pretty-class (class-precedence-list class))