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 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(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 @@
(defun %print-unreadable-object (object stream type identity body)
(when *print-readably*
(error 'print-not-readable :object object))
(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)
(cond (*print-pretty*
(pprint-logical-block (stream nil :prefix "#<" :suffix ">")
(when type
(write (type-of object) :stream stream :circle nil
:level nil :length nil)
(when (or body identity)
(write-char #\space stream)
(pprint-newline :fill stream)))
(when body
(funcall body))
(when identity
(when body
(write-char #\space stream)
(pprint-newline :fill 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)
......
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