From 27155202e7a3c0e997a4fad7ba2aa01fa1a2b7a9 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Wed, 27 Mar 2002 00:14:21 +0000 Subject: [PATCH] 0.7.2.3: stole Eric Marsden's CMU CL DESCRIBE-type-specifier patch for CMU CL (cmucl-imp 2002-03-21) other cleanups/fixes on DESCRIBE... ...made sub-DESCRIBE of SYMBOL-NAMED-CLASS go to S instead of *STANDARD-OUTPUT* ...converted some raw format control to pretty-printer format control ...wrapped pprint-logical-blocks around some stuff which doesn't benefit from internal line breaks --- NEWS | 7 +++++++ src/code/describe.lisp | 34 +++++++++++++++++++--------------- version.lisp-expr | 2 +- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index ef442af..8e5819c 100644 --- a/NEWS +++ b/NEWS @@ -1058,6 +1058,13 @@ changes in sbcl-0.7.2 relative to sbcl-0.7.1: encapsulation also seems closer to the spirit of the ANSI specification.) +changes in sbcl-0.7.2 relative to sbcl-0.7.1: + * cleanups on SPARC, both Linux and Solaris, and for gcc>=3 (thanks + to Christophe Rhodes and Nathan Froyd) + * DESCRIBE on a symbol now says something about DEFTYPE-style + expansions associated with the symbol (thanks to Eric Marsden's + patch for CMU CL). + planned incompatible changes in 0.7.x: * When the profiling interface settles down, maybe in 0.7.x, maybe later, it might impact TRACE. They both encapsulate functions, and diff --git a/src/code/describe.lisp b/src/code/describe.lisp index 0638202..5033aa1 100644 --- a/src/code/describe.lisp +++ b/src/code/describe.lisp @@ -233,9 +233,9 @@ (multiple-value-bind (symbol status) (find-symbol (symbol-name x) package) (declare (ignore symbol)) - (format s "~S is ~_an ~(~A~) symbol ~_in ~S." + (format s "~@<~S is ~_an ~(~A~) symbol ~_in ~S.~:>" x status (symbol-package x))) - (format s "~S is ~_an uninterned symbol." x))) + (format s "~@<~S is ~_an uninterned symbol.~:>" x))) ;; TO DO: We could grovel over all packages looking for and ;; reporting other phenomena, e.g. IMPORT and SHADOW, or ;; availability in some package even after (SYMBOL-PACKAGE X) has @@ -258,12 +258,13 @@ (format s "~@" (eval x)))) ((boundp x) - (format s "~@:_It is a ~A; its ~_value is ~S." wot (symbol-value x))) + (format s "~@:_~@" + wot (symbol-value x))) ((not (eq kind :global)) - (format s "~@:_It is a ~A; no current value." wot))) + (format s "~@:_~@" wot))) (when (eq (info :variable :where-from x) :declared) - (format s "~@:_Its declared type ~_is ~S." + (format s "~@:_~@" (type-specifier (info :variable :type x)))) (%describe-doc x s 'variable kind)) @@ -279,25 +280,28 @@ ((fboundp x) (describe-symbol-fdefinition (fdefinition x) s :name x))) - ;; FIXME: Print out other stuff from the INFO database: - ;; * Does it name a type? - ;; * Is it a structure accessor? (This is important since those are - ;; magical in some ways, e.g. blasting the structure if you - ;; redefine them.) - ;; Print other documentation. (%describe-doc x s 'structure "Structure") (%describe-doc x s 'type "Type") (%describe-doc x s 'setf "Setf macro") - (dolist (assoc (info :random-documentation :stuff x)) (format s "~@:_Documentation on the ~(~A~):~@:_~A" (car assoc) (cdr assoc))) - ;; Describe the associated class, if any. + ;; Mention the associated type information, if any. + ;; + ;; As of sbcl-0.7.2, (INFO :TYPE :KIND X) might be + ;; * :PRIMITIVE, which is handled by the FIND-CLASS case. + ;; * :DEFINED, which is handled specially. + ;; * :INSTANCE, which is handled by the FIND-CLASS case. + ;; * :FORTHCOMING-DEFCLASS-TYPE, which is an internal-to-the-compiler + ;; note that we don't try to report. + ;; * NIL, in which case there's nothing to see here, move along. + (when (eq (info :type :kind x) :defined) + (format s "~@:_It names a type specifier.")) (let ((symbol-named-class (cl:find-class x nil))) (when symbol-named-class - (format s "~&It names a class ~A." symbol-named-class) - (describe symbol-named-class)))) + (format s "~@:_It names a class ~A." symbol-named-class) + (describe symbol-named-class s)))) diff --git a/version.lisp-expr b/version.lisp-expr index 45ed2cb..3f8d9ad 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.2.2" +"0.7.2.3" -- 1.7.10.4