From 1de0cc3df508a887bcbbd8ab76d0d62929806c42 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sat, 18 Aug 2007 04:02:15 +0000 Subject: [PATCH] 1.0.8.29: better printing of anonymous objects * In PCL, the NAMED-OBJECT-PRINT-FUNCTION prints the identity of the object when it has no name. Among other things, it affects the printing of anonymous classes. Thanks to Attila Lendvai. --- NEWS | 3 +++ src/pcl/print-object.lisp | 14 +++++--------- version.lisp-expr | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 163c373eb..4a3017685 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ changes in sbcl-1.0.9 relative to sbcl-1.0.8: * enhancement: SB-EXT:FINALIZE accepts a :DONT-SAVE keyword argument, indicating the finalizer should be cancelled when SAVE-LISP-AND-DIE is called. + * enhancement: default PRINT-OBJECT methods for classes, slot-definitions, + and generic function now print the object identity for anonymous + instances. (thanks to Attila Lendvai) * bug fix: new compiler transforms for MEMBER and ASSOC were affected by printer control variables. (reported by Dan Corkill) * bug fix: system leaked memory when delayed output was performed by diff --git a/src/pcl/print-object.lisp b/src/pcl/print-object.lisp index df187c37d..50153b2af 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)) diff --git a/version.lisp-expr b/version.lisp-expr index 2609d30b6..ee5a5c6bd 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.8.28" +"1.0.8.29" -- 2.11.4.GIT