projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.pre7.6:
[sbcl.git]
/
src
/
code
/
describe.lisp
diff --git
a/src/code/describe.lisp
b/src/code/describe.lisp
index
ad2b039
..
3b650bc
100644
(file)
--- a/
src/code/describe.lisp
+++ b/
src/code/describe.lisp
@@
-10,10
+10,9
@@
;;;; provided with absolutely no warranty. See the COPYING and CREDITS
;;;; files for more information.
;;;; provided with absolutely no warranty. See the COPYING and CREDITS
;;;; files for more information.
-(in-package "SB-IMPL")
+(in-package "SB-IMPL") ;(SB-IMPL, not SB!IMPL, since we're built in warm load.)
-;; byte-compile this file
-(declaim (optimize (speed 0) (safety 1)))
+(declaim #.*optimize-byte-compilation*)
\f
(defvar *describe-indentation-step* 3
\f
(defvar *describe-indentation-step* 3
@@
-26,6
+25,7
@@
(defun describe (x &optional (stream-designator *standard-output*))
#+sb-doc
"Print a description of the object X."
(defun describe (x &optional (stream-designator *standard-output*))
#+sb-doc
"Print a description of the object X."
+ (declare #.*optimize-external-despite-byte-compilation*)
(let ((stream (out-synonym-of stream-designator)))
(pprint-logical-block (stream nil)
(fresh-line stream)
(let ((stream (out-synonym-of stream-designator)))
(pprint-logical-block (stream nil)
(fresh-line stream)
@@
-181,8
+181,8
@@
(ecase (sb-c::debug-source-from source)
(:file
(format s "~@:_~A~@:_ Created: " (namestring name))
(ecase (sb-c::debug-source-from source)
(:file
(format s "~@:_~A~@:_ Created: " (namestring name))
- (sb-int:format-universal-time s (sb-c::debug-source-created
- source)))
+ (format-universal-time s (sb-c::debug-source-created
+ source)))
(:lisp (format s "~@:_~S" name))))))))))
;;; Describe a compiled function. The closure case calls us to print
(:lisp (format s "~@:_~S" name))))))))))
;;; Describe a compiled function. The closure case calls us to print
@@
-325,8
+325,8
@@
((fboundp x)
(%describe-function (fdefinition x) s :function x)))
((fboundp x)
(%describe-function (fdefinition x) s :function x)))
- ;; TO DO: Print out other stuff from the INFO database:
- ;; * Does it name a type or class?
+ ;; 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.)
;; * Is it a structure accessor? (This is important since those are
;; magical in some ways, e.g. blasting the structure if you
;; redefine them.)
@@
-335,8
+335,15
@@
(%describe-doc x s 'structure "Structure")
(%describe-doc x s 'type "Type")
(%describe-doc x s 'setf "Setf macro")
(%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)
(dolist (assoc (info :random-documentation :stuff x))
(format s
"~@:_Documentation on the ~(~A~):~@:_~A"
(car assoc)
- (cdr assoc))))
+ (cdr assoc)))
+
+ ;; Describe the associated class, if any.
+ (let ((symbol-named-class (cl:find-class x nil)))
+ (when symbol-named-class
+ (format t "~&It names a class ~A." symbol-named-class)
+ (describe symbol-named-class))))