X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fprint-object.lisp;h=b5c25007860b26487bbbdc318a84dd4311155620;hb=95d19447c10434753c2168ac943152fd5e3ded3d;hp=b3774441099696cef9446da9202460ecb6966779;hpb=990728854b8ba017888811d1b0453b15dfa8a581;p=sbcl.git diff --git a/src/pcl/print-object.lisp b/src/pcl/print-object.lisp index b377444..b5c2500 100644 --- a/src/pcl/print-object.lisp +++ b/src/pcl/print-object.lisp @@ -102,15 +102,11 @@ (defun named-object-print-function (instance stream &optional (extra nil extra-p)) - (print-unreadable-object (instance stream :type t) - (if extra-p - (format stream - "~S ~:S" - (slot-value-or-default instance 'name) - extra) - (format stream - "~S" - (slot-value-or-default instance 'name))))) + (let ((name (slot-value-or-default instance 'name))) + (print-unreadable-object (instance stream :type t :identity (not name)) + (if extra-p + (format stream "~S ~:S" name extra) + (format stream "~S" name))))) (defmethod print-object ((class class) stream) (named-object-print-function class stream)) @@ -131,7 +127,7 @@ (multiple-value-bind (lines-used lines-total max-depth depth-limit) (cache-statistics cache) (format stream - "~D key, ~P~:[no value~;value~], ~D/~D lines, depth ~D/~D" + "~D key~P, ~:[no value~;value~], ~D/~D lines, depth ~D/~D" (cache-key-count cache) (cache-key-count cache) (cache-value cache) @@ -147,3 +143,8 @@ (defmethod print-object ((dfun-info dfun-info) stream) (declare (type stream stream)) (print-unreadable-object (dfun-info stream :type t :identity t))) + +(defmethod print-object ((ctor ctor) stream) + (print-unreadable-object (ctor stream :type t) + (format stream "~S ~:S" (ctor-class-or-name ctor) (ctor-initargs ctor))) + ctor)