X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdescribe.lisp;h=252f264f4afaec3d32ae57de754a483558aecff5;hb=02c9007b4ca5753406f60019f4fe5e5f8392541a;hp=35cd2657b5e9c568f6f61b87ea61515c0d667bbf;hpb=c25e4572f5505236faf126f38a74f32a80bf1e8c;p=sbcl.git diff --git a/src/code/describe.lisp b/src/code/describe.lisp index 35cd265..252f264 100644 --- a/src/code/describe.lisp +++ b/src/code/describe.lisp @@ -13,7 +13,7 @@ (in-package "SB-IMPL") ;(SB-IMPL, not SB!IMPL, since we're built in warm load.) (declaim (ftype (function (t stream)) describe-object)) -(defgeneric describe-object ((x t) stream)) +(defgeneric describe-object (x stream)) (defun describe (x &optional (stream-designator *standard-output*)) #+sb-doc @@ -43,18 +43,18 @@ (defmethod describe-object ((x array) s) (let ((rank (array-rank x))) - (cond ((> rank 1) - (format s "~S ~_is " x) - (write-string (if (%array-displaced-p x) "a displaced" "an") s) - (format s " array of rank ~S." rank) - (format s "~@:_Its dimensions are ~S." (array-dimensions x))) - (t + (cond ((= rank 1) (format s "~@:_~S is a ~:[~;displaced ~]vector of length ~S." x (and (array-header-p x) (%array-displaced-p x)) (length x)) (when (array-has-fill-pointer-p x) (format s "~@:_It has a fill pointer, currently ~S." - (fill-pointer x)))))) + (fill-pointer x)))) + (t + (format s "~S ~_is " x) + (write-string (if (%array-displaced-p x) "a displaced" "an") s) + (format s " array of rank ~S." rank) + (format s "~@:_Its dimensions are ~S." (array-dimensions x))))) (let ((array-element-type (array-element-type x))) (unless (eq array-element-type t) (format s @@ -110,7 +110,7 @@ (defun %describe-fun-name (name s type-spec) (when (and name (typep name '(or symbol cons))) (multiple-value-bind (type where) - (if (or (symbolp name) (and (listp name) (eq (car name) 'setf))) + (if (legal-fun-name-p name) (values (type-specifier (info :function :type name)) (info :function :where-from name)) (values type-spec :defined)) @@ -185,7 +185,7 @@ (:function (if name (format s "Function: ~S" x) (format s "~S is a function." x)))) - (format s "~@:_Its associated name (as in ~S) is ~S." + (format s "~@:_~@" 'function-lambda-expression (%fun-name x)) (case (widetag-of x) @@ -209,7 +209,7 @@ (defmethod describe-object ((x function) s) (%describe-fun x s :function)) -(defgeneric describe-symbol-fdefinition (function stream &key (name nil) )) +(defgeneric describe-symbol-fdefinition (function stream &key name)) (defmethod describe-symbol-fdefinition ((fun function) stream &key name) (%describe-fun fun stream :function name)) @@ -301,7 +301,7 @@ ;; * 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))) + (let ((symbol-named-class (find-classoid x nil))) (when symbol-named-class (format s "~@:_It names a class ~A." symbol-named-class) (describe symbol-named-class s))))