X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpp-backq.lisp;h=9b2ff78bc72b2f8c81650ce04b4baa773efd73f2;hb=4ed3f0d08c3a57a6762018d9622f253ab9d0f2b6;hp=bbc1e858fb8f00c198e25019e7c720b2611c68b0;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/code/pp-backq.lisp b/src/code/pp-backq.lisp index bbc1e85..9b2ff78 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,12 +78,23 @@ (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 + (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-sequence output stream)))) ;;; This is called by !PPRINT-COLD-INIT, fairly late, because ;;; SET-PPRINT-DISPATCH doesn't work until the compiler works. ;;; -;;; FIXME: It might be cleaner to just make these toplevel forms and +;;; FIXME: It might be cleaner to just make these be toplevel forms and ;;; enforce the delay by putting this file late in the build sequence. (defun !backq-pp-cold-init () (set-pprint-dispatch '(cons (eql backq-list)) #'pprint-backquote)