X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpprint.lisp;h=1e39693014fc03b989315c0160fc0a4c89c2e0bc;hb=829ced3e78a23ba153ba4db64e6ea6984c2313b6;hp=07f87255d41ae5d9e868b9a769a72e1d5098ff5a;hpb=70a16828572748140239e3c74f34a2967e1e5131;p=sbcl.git diff --git a/src/code/pprint.lisp b/src/code/pprint.lisp index 07f8725..1e39693 100644 --- a/src/code/pprint.lisp +++ b/src/code/pprint.lisp @@ -75,12 +75,12 @@ ;; Buffer holding the per-line prefix active at the buffer start. ;; Indentation is included in this. The length of this is stored ;; in the logical block stack. - (prefix (make-string initial-buffer-size) :type simple-string) + (prefix (make-string initial-buffer-size) :type (simple-array character (*))) ;; Buffer holding the total remaining suffix active at the buffer start. ;; The characters are right-justified in the buffer to make it easier ;; to output the buffer. The length is stored in the logical block ;; stack. - (suffix (make-string initial-buffer-size) :type simple-string) + (suffix (make-string initial-buffer-size) :type (simple-array character (*))) ;; Queue of pending operations. When empty, HEAD=TAIL=NIL. Otherwise, ;; TAIL holds the first (oldest) cons and HEAD holds the last (newest) ;; cons. Adding things to the queue is basically (setf (cdr head) (list @@ -1007,16 +1007,11 @@ line break." (output-ugly-object array stream)) ((and *print-readably* (not (array-readably-printable-p 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)))) + (if *read-eval* + (if (vectorp array) + (sb!impl::output-unreadable-vector-readably array stream) + (sb!impl::output-unreadable-array-readably array stream)) + (print-not-readable-error array stream))) ((vectorp array) (pprint-vector stream array)) (t @@ -1145,7 +1140,10 @@ line break." (declare (ignore noise)) (if (and (consp list) (consp (cdr list)) - (cddr list)) + (cddr list) + ;; Filter out (FLET FOO :IN BAR) names. + (and (consp (cddr list)) + (not (eq :in (third list))))) (funcall (formatter "~:<~^~W~^ ~@_~:<~@{~:<~^~W~^~3I ~:_~/SB!PRETTY:PPRINT-LAMBDA-LIST/~1I~:@_~@{~W~^ ~_~}~:>~^ ~_~}~:>~1I~@:_~@{~W~^ ~_~}~:>") stream @@ -1269,7 +1267,9 @@ line break." (defun pprint-defmethod (stream list &rest noise) (declare (ignore noise)) - (if (consp (third list)) + (if (and (consp (cdr list)) + (consp (cddr list)) + (consp (third list))) (pprint-defun stream list) (funcall (formatter "~:<~^~W~^ ~@_~:I~W~^ ~W~^ ~:_~/SB!PRETTY:PPRINT-LAMBDA-LIST/~1I~@{ ~_~W~}~:>") @@ -1376,7 +1376,7 @@ line break." (declare (ignore noise)) (destructuring-bind (loop-symbol . clauses) list (declare (ignore loop-symbol)) - (if (or (null clauses) (consp (car clauses))) + (if (or (atom clauses) (consp (car clauses))) (pprint-spread-fun-call stream list) (pprint-extended-loop stream list))))