X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdescribe.lisp;h=7da9cd7a0cdab08a8c21a23ed270789e0dca94f7;hb=fbae90af33b92c5411ddcb419485dcf2bca47ab7;hp=51a5cfd767570629360d1677fcaff4ce4855c4c7;hpb=970dd272dc84f7420252eadb4829cc193f795716;p=sbcl.git diff --git a/src/code/describe.lisp b/src/code/describe.lisp index 51a5cfd..7da9cd7 100644 --- a/src/code/describe.lisp +++ b/src/code/describe.lisp @@ -95,7 +95,7 @@ count (zerop count)) (let ((n 0)) (declare (type index n)) - (dohash (k v x) + (dohash ((k v) x :locked t) (unless (zerop n) (write-char #\space s)) (incf n) @@ -161,12 +161,14 @@ ;; any nondefault options. (format-universal-time nil (sb-c::debug-source-compiled source) :style :abbreviated)) - (let ((name (sb-c::debug-source-name source))) - (ecase (sb-c::debug-source-from source) - (:file - (format s "~&~A~@:_ Created: " (namestring name)) - (format-universal-time s (sb-c::debug-source-created source))) - (:lisp (format s "~& ~S" (aref name 0)))))))))) + (let ((name (sb-c::debug-source-namestring source))) + (cond (name + (format s "~&~A~@:_ Created: " name) + (format-universal-time s (sb-c::debug-source-created source))) + ((sb-di:debug-source-form source) + (format s "~& ~S" (sb-di:debug-source-form source))) + (t (bug "Don't know how to use a DEBUG-SOURCE without ~ + a namestring or a form."))))))))) ;;; Describe a compiled function. The closure case calls us to print ;;; the guts. @@ -310,7 +312,8 @@ (:special "special variable") (:macro "symbol macro") (:constant "constant") - (:global "undefined variable") + (:global "global variable") + (:unknown "undefined variable") (:alien nil)))) (pprint-logical-block (s nil) (cond @@ -328,7 +331,7 @@ ((boundp x) (format s "~&~@" wot (symbol-value x))) - ((not (eq kind :global)) + ((not (eq kind :unknown)) (format s "~&~@" wot))) (when (eq (info :variable :where-from x) :declared) @@ -348,15 +351,22 @@ ((fboundp x) (describe-symbol-fdefinition (fdefinition x) s :name x))) + ;; Describe deftype lambda-list and doc + (when (info :type :expander x) + (format s "~&DEFTYPE lambda-list: ~A" (info :type :lambda-list x)) + (%describe-doc x s 'type "Type")) + ;; 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 - "~&~@" - (car assoc) - (cdr assoc))) + (let ((type (car assoc))) + (format s + "~&~@" + (case type + ((optimize) "optimize quality") + (t (car assoc))) + (cdr assoc)))) ;; Mention the associated type information, if any. ;;