Skip to content
Snippets Groups Projects
Commit ce89644b authored by dtc's avatar dtc
Browse files

o Have print-unreadable-object respect *print-pretty*.

parent f600b660
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/print.lisp,v 1.76 2000/04/29 04:09:17 dtc Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/print.lisp,v 1.77 2000/12/27 13:24:29 dtc Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -255,22 +255,41 @@ ...@@ -255,22 +255,41 @@
(defun %print-unreadable-object (object stream type identity body) (defun %print-unreadable-object (object stream type identity body)
(when *print-readably* (when *print-readably*
(error 'print-not-readable :object object)) (error 'print-not-readable :object object))
(write-string "#<" stream) (cond (*print-pretty*
(when type (pprint-logical-block (stream nil :prefix "#<" :suffix ">")
(write (type-of object) :stream stream :circle nil (when type
:level nil :length nil) (write (type-of object) :stream stream :circle nil
(when (or body identity) :level nil :length nil)
(write-char #\space stream))) (when (or body identity)
(when body (write-char #\space stream)
(funcall body)) (pprint-newline :fill stream)))
(when identity (when body
(when body (funcall body))
(write-char #\space stream)) (when identity
(write-char #\{ stream) (when body
(write (get-lisp-obj-address object) :stream stream (write-char #\space stream)
:radix nil :base 16) (pprint-newline :fill stream))
(write-char #\} stream)) (write-char #\{ stream)
(write-char #\> stream) (write (get-lisp-obj-address object) :stream stream
:radix nil :base 16)
(write-char #\} stream))))
(t
(write-string "#<" stream)
(when type
(write (type-of object) :stream stream :circle nil
:level nil :length nil)
(when (or body identity)
(write-char #\space stream)))
(when body
(funcall body))
(when identity
(when body
(write-char #\space stream))
(write-char #\{ stream)
(write (get-lisp-obj-address object) :stream stream
:radix nil :base 16)
(write-char #\} stream))
(write-char #\> stream)))
nil) nil)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment