;; 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
"Output a conditional newline to STREAM (which defaults to
*STANDARD-OUTPUT*) if it is a pretty-printing stream, and do
nothing if not. KIND can be one of:
- :LINEAR - A line break is inserted if and only if the immediatly
+ :LINEAR - A line break is inserted if and only if the immediately
containing section cannot be printed on one line.
:MISER - Same as LINEAR, but only if ``miser-style'' is in effect.
(See *PRINT-MISER-WIDTH*.)
line and miser-style is in effect.
:MANDATORY - A line break is always inserted.
When a line break is inserted by any type of conditional newline, any
- blanks that immediately precede the conditional newline are ommitted
+ blanks that immediately precede the conditional newline are omitted
from the output and indentation is introduced at the beginning of the
next line. (See PPRINT-INDENT.)"
(declare (type (member :linear :miser :fill :mandatory) kind)
(consp (cdr list))
(cddr list)
;; Filter out (FLET FOO :IN BAR) names.
- (not (eq :in (third list))))
+ (and (consp (cddr list))
+ (not (eq :in (third list)))))
(funcall (formatter
"~:<~^~W~^ ~@_~:<~@{~:<~^~W~^~3I ~:_~/SB!PRETTY:PPRINT-LAMBDA-LIST/~1I~:@_~@{~W~^ ~_~}~:>~^ ~_~}~:>~1I~@:_~@{~W~^ ~_~}~:>")
stream
(output-object (pprint-pop) stream)
(pprint-exit-if-list-exhausted)
(write-char #\space stream)
+ (unless (listp (cdr list))
+ (write-string ". " stream))
(pprint-newline :miser stream)
(pprint-logical-block (stream (cdr list) :prefix "" :suffix "")
(loop
(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~}~:>")
(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))))