X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Fpprint.lisp;h=c8e23015fc2e6d155abf43dee85fb1ba94a22e8f;hb=3ccd2c124ae60833f54406a2b478d13835e4b7df;hp=d0f7b57e6c1a80f7ab75f60f6dc054a3d600c82f;hpb=2a1df4bcc815f763fac346f32fbe535b39a0d2e1;p=sbcl.git diff --git a/src/code/pprint.lisp b/src/code/pprint.lisp index d0f7b57..c8e2301 100644 --- a/src/code/pprint.lisp +++ b/src/code/pprint.lisp @@ -1009,8 +1009,16 @@ line break." (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 @@ -1261,6 +1269,15 @@ line break." stream list)) +(defun pprint-defmethod (stream list &rest noise) + (declare (ignore noise)) + (if (consp (third list)) + (pprint-defun stream list) + (funcall (formatter + "~:<~^~W~^ ~@_~:I~W~^ ~W~^ ~:_~/SB!PRETTY:PPRINT-LAMBDA-LIST/~1I~@{ ~_~W~}~:>") + stream + list))) + (defun pprint-defpackage (stream list &rest noise) (declare (ignore noise)) (funcall (formatter @@ -1518,6 +1535,7 @@ line break." (define-modify-macro pprint-defun) (define-setf-expander pprint-defun) (defmacro pprint-defun) + (defmethod pprint-defmethod) (defpackage pprint-defpackage) (defparameter pprint-block) (defsetf pprint-defun) @@ -1581,5 +1599,6 @@ line break." (setf *standard-pprint-dispatch-table* (copy-pprint-dispatch *initial-pprint-dispatch-table*)) - (setf *print-pprint-dispatch* *initial-pprint-dispatch-table*) + (setf *print-pprint-dispatch* + (copy-pprint-dispatch *initial-pprint-dispatch-table*)) (setf *print-pretty* t))