X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpp-backq.lisp;h=9c4c7c9f8bc324f58240a4c1e3ba7e2576ca6537;hb=c6b052b5c190f24ac8e03d69bfc5d333f268b960;hp=b1d5cc44d908a08168af9e71794b64b63b177656;hpb=b08344ddbb8d0193054b72c01be7e367422ccf03;p=sbcl.git diff --git a/src/code/pp-backq.lisp b/src/code/pp-backq.lisp index b1d5cc4..9c4c7c9 100644 --- a/src/code/pp-backq.lisp +++ b/src/code/pp-backq.lisp @@ -49,10 +49,10 @@ (backq-unparse (car tail) t))) (push (backq-unparse (car tail)) accum))) (backq-append - (mapcan #'(lambda (el) (backq-unparse el t)) + (mapcan (lambda (el) (backq-unparse el t)) (cdr form))) (backq-nconc - (mapcan #'(lambda (el) (backq-unparse el :nconc)) + (mapcan (lambda (el) (backq-unparse el :nconc)) (cdr form))) (backq-cons (cons (backq-unparse (cadr form) nil) @@ -78,7 +78,24 @@ (princ ",@" stream)) (backq-comma-dot (princ ",." stream))) - (write (cadr form) :stream stream)) + ;; Ha! an example of where the per-process specials for stream + ;; attributes rather than per-stream actually makes life easier. + ;; Since all of the attributes are shared in the dynamic state, we + ;; can do... -- CSR, 2003-09-30 + ;; + ;; [...] above referred to the trick of printing to a string stream, + ;; and then simply printing the resulting sequence to the pretty + ;; stream, possibly with a space prepended. However, this doesn't + ;; work for pretty streams which need to do margin calculations. Oh + ;; well. It was good while it lasted. -- CSR, 2003-12-15 + (let ((output (with-output-to-string (s) + (write (cadr form) :stream s)))) + (unless (= (length output) 0) + (when (and (eql (car form) 'backq-comma) + (or (char= (char output 0) #\.) + (char= (char output 0) #\@))) + (write-char #\Space stream)) + (write (cadr form) :stream stream)))) ;;; This is called by !PPRINT-COLD-INIT, fairly late, because ;;; SET-PPRINT-DISPATCH doesn't work until the compiler works.