X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpprint.lisp;h=bc265100fc1823ac0baec422d65f7f097374f6ea;hb=bea5b384106a6734a4b280a76e8ebdd4d51b5323;hp=90ea31d620bb567ed1a980ddce9361220c7b40d5;hpb=771b864c8f32af7734bc0550aeaf1539fc4df194;p=sbcl.git diff --git a/src/code/pprint.lisp b/src/code/pprint.lisp index 90ea31d..bc26510 100644 --- a/src/code/pprint.lisp +++ b/src/code/pprint.lisp @@ -119,7 +119,7 @@ (defun pretty-out (stream char) (declare (type pretty-stream stream) - (type base-char char)) + (type character char)) (cond ((char= char #\newline) (enqueue-newline stream :literal)) (t @@ -1099,10 +1099,19 @@ (defun pprint-flet (stream list &rest noise) (declare (ignore noise)) - (funcall (formatter - "~:<~^~W~^ ~@_~:<~@{~:<~^~W~^~3I ~:_~/SB!PRETTY:PPRINT-LAMBDA-LIST/~1I~:@_~@{~W~^ ~_~}~:>~^ ~_~}~:>~1I~@:_~@{~W~^ ~_~}~:>") - stream - list)) + (if (cddr list) + (funcall (formatter + "~:<~^~W~^ ~@_~:<~@{~:<~^~W~^~3I ~:_~/SB!PRETTY:PPRINT-LAMBDA-LIST/~1I~:@_~@{~W~^ ~_~}~:>~^ ~_~}~:>~1I~@:_~@{~W~^ ~_~}~:>") + stream + list) + ;; for printing function names like (flet foo) + (pprint-logical-block (stream list :prefix "(" :suffix ")") + (pprint-exit-if-list-exhausted) + (write (pprint-pop) :stream stream) + (loop + (pprint-exit-if-list-exhausted) + (write-char #\space stream) + (write (pprint-pop) :stream stream))))) (defun pprint-let (stream list &rest noise) (declare (ignore noise))