From: Nikodemus Siivola Date: Tue, 6 Dec 2011 00:07:24 +0000 (+0200) Subject: DESCRIBE improvements X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=ffd12e0c622d7754967a72e424750f137c909ac8;p=sbcl.git DESCRIBE improvements * Nicer DESCRIBE for type designators. Use TYPEXPAND-1 to get it done right. * Bind *PRINT-CIRCLE* to NIL around lambda-list printing, but compensate with *PRINT-LEVEL* and *PRINT-LENGTH* for sanity's sake. --- diff --git a/src/code/describe.lisp b/src/code/describe.lisp index 828227a..2d41172 100644 --- a/src/code/describe.lisp +++ b/src/code/describe.lisp @@ -312,8 +312,11 @@ (%fun-lambda-list fun) (info :type :lambda-list symbol)) stream) - (when (eq (%fun-fun fun) (%fun-fun (constant-type-expander t))) - (format stream "~@:_Expansion: ~S" (funcall fun (list symbol)))))) + (multiple-value-bind (expansion ok) + (handler-case (typexpand-1 symbol) + (error () (values nil nil))) + (when ok + (format stream "~@:_Expansion: ~S" expansion))))) (terpri stream))) (when (or (member symbol sb-c::*policy-qualities*) @@ -501,7 +504,10 @@ (format stream "~@:_~A:~@<~;~{ ~A~^,~:_~}~;~:>" label list)))) (defun describe-lambda-list (lambda-list stream) - (format stream "~@:_Lambda-list: ~:A" lambda-list)) + (let ((*print-circle* nil) + (*print-level* 24) + (*print-length* 24)) + (format stream "~@:_Lambda-list: ~:A" lambda-list))) (defun describe-function-source (function stream) (if (compiled-function-p function)