X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpprint.lisp;h=07f87255d41ae5d9e868b9a769a72e1d5098ff5a;hb=ecfd159f29d31d2cc08d4e5598346c04c9387636;hp=c0ab2472c23db2206edf655f517c3b393d0d2de6;hpb=a51d83191034919bc76367268929e234d62164db;p=sbcl.git diff --git a/src/code/pprint.lisp b/src/code/pprint.lisp index c0ab247..07f8725 100644 --- a/src/code/pprint.lisp +++ b/src/code/pprint.lisp @@ -1003,14 +1003,20 @@ line break." ;;;; standard pretty-printing routines (defun pprint-array (stream array) - (cond ((or (and (null *print-array*) (null *print-readably*)) - (stringp array) - (bit-vector-p array)) + (cond ((and (null *print-array*) (null *print-readably*)) (output-ugly-object array stream)) ((and *print-readably* (not (array-readably-printable-p array))) - (let ((*print-readably* nil)) - (error 'print-not-readable :object array))) + (restart-case + (error 'print-not-readable :object array) + (print-unreadably () + :report "Print unreadably." + (let ((*print-readably* nil)) + (pprint-array stream array))) + (use-value (o) + :report "Supply an object to be printed instead." + :interactive read-unreadable-replacement + (write o :stream stream)))) ((vectorp array) (pprint-vector stream array)) (t @@ -1480,7 +1486,7 @@ line break." (let ((*print-pprint-dispatch* *initial-pprint-dispatch-table*) (*building-initial-table* t)) (/show0 "doing SET-PPRINT-DISPATCH for regular types") - (set-pprint-dispatch 'array #'pprint-array) + (set-pprint-dispatch '(and array (not (or string bit-vector))) #'pprint-array) (set-pprint-dispatch '(cons (and symbol (satisfies mboundp))) #'pprint-macro-call -1) (set-pprint-dispatch '(cons (and symbol (satisfies fboundp)))