From a22dd643fb599880f4c0856e1a85bffe4358aea8 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 6 Feb 2004 13:36:04 +0000 Subject: [PATCH] 0.8.7.46: Improve DESCRIBE and INSPECT slightly ... make condition objects less opaque to inspect ... likewise funcallable-instances ... make generic functions /more/ opaque to DESCRIBE... ... so now (describe #'print-object) only takes up 4 screens, not hundreds --- contrib/sb-aclrepl/inspect.lisp | 6 +++++- src/code/inspect.lisp | 8 +++++++- src/pcl/describe.lisp | 12 +++++++----- version.lisp-expr | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/contrib/sb-aclrepl/inspect.lisp b/contrib/sb-aclrepl/inspect.lisp index 2a7f83f..b09fc59 100644 --- a/contrib/sb-aclrepl/inspect.lisp +++ b/contrib/sb-aclrepl/inspect.lisp @@ -781,7 +781,11 @@ cons cells and LIST-TYPE is :normal, :dotted, or :cyclic" (list components (length components) :named nil))) (defmethod inspected-parts ((object sb-kernel:funcallable-instance)) - (let ((components (inspected-structure-parts object))) + (let ((components (inspected-standard-object-parts object))) + (list components (length components) :named nil))) + +(defmethod inspected-parts ((object condition)) + (let ((components (inspected-standard-object-parts object))) (list components (length components) :named nil))) (defmethod inspected-parts ((object function)) diff --git a/src/code/inspect.lisp b/src/code/inspect.lisp index f975aed..43faa94 100644 --- a/src/code/inspect.lisp +++ b/src/code/inspect.lisp @@ -202,7 +202,13 @@ evaluated expressions. (values (format nil "The object is a FUNCALLABLE-INSTANCE of type ~S.~%" (type-of object)) t - (inspected-structure-elements object))) + (inspected-standard-object-elements object))) + +(defmethod inspected-parts ((object condition)) + (values (format nil "The object is a CONDITION of type ~S.~%" + (type-of object)) + t + (inspected-standard-object-elements object))) (defmethod inspected-parts ((object function)) (let* ((type (sb-kernel:widetag-of object)) diff --git a/src/pcl/describe.lisp b/src/pcl/describe.lisp index edaa29d..d459b53 100644 --- a/src/pcl/describe.lisp +++ b/src/pcl/describe.lisp @@ -91,7 +91,9 @@ (defmethod describe-object ((fun standard-generic-function) stream) (format stream "~&~A is a generic function." fun) - (format stream "~&Its arguments are:~& ~S" + (when (documentation fun t) + (format stream "~& Function documentation: ~A" (documentation fun t))) + (format stream "~&Its lambda-list is:~& ~S" (generic-function-pretty-arglist fun)) (let ((methods (generic-function-methods fun))) (if (null methods) @@ -99,13 +101,13 @@ (let ((gf-name (generic-function-name fun))) (format stream "~&Its methods are:") (dolist (method methods) - (format stream "~2% (~A ~{~S ~}~:S) =>" + (format stream "~& (~A ~{~S ~}~:S)~%" gf-name (method-qualifiers method) (unparse-specializers method)) - (describe (or (method-fast-function method) - (method-function method)) - stream)))))) + (when (documentation method t) + (format stream "~& Method documentation: ~A" + (documentation method t)))))))) (defmethod describe-object ((class class) stream) (flet ((pretty-class (c) (or (class-name c) c))) diff --git a/version.lisp-expr b/version.lisp-expr index 6ff65c0..01b9d72 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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".) -"0.8.7.45" +"0.8.7.46" -- 1.7.10.4