From 83acd60c82635c4a1a3ffe5f0b2a3bbb6a2cce99 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Fri, 11 Feb 2005 12:09:44 +0000 Subject: [PATCH] 0.8.19.24: Fix ansi-test failures related to pretty-printing backquoted forms when *PRINT-CIRCLE* is true. Print the ",@" and ",." tokens with WRITE-STRING instead of PRINC to prevent circularity detection from applying to them. --- NEWS | 2 ++ src/code/pp-backq.lisp | 4 ++-- tests/backq.impure.lisp | 4 ++++ version.lisp-expr | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d105bd7..2c89306 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,8 @@ changes in sbcl-0.8.20 (0.9alpha.0?) relative to sbcl-0.8.19: syntax. ** WITH-INPUT-FROM-STRING should only update the index place on normal termination. + ** Pretty-printing backquoted forms when *PRINT-CIRCLE* is true + works more reliably. changes in sbcl-0.8.19 relative to sbcl-0.8.18: * new port: SBCL now works in native 64-bit mode on x86-64/Linux diff --git a/src/code/pp-backq.lisp b/src/code/pp-backq.lisp index dc5d6ae..7905ce7 100644 --- a/src/code/pp-backq.lisp +++ b/src/code/pp-backq.lisp @@ -83,9 +83,9 @@ (backq-comma (write-char #\, stream)) (backq-comma-at - (princ ",@" stream)) + (write-string ",@" stream)) (backq-comma-dot - (princ ",." stream))) + (write-string ",." 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 diff --git a/tests/backq.impure.lisp b/tests/backq.impure.lisp index ffdeb93..65583f5 100644 --- a/tests/backq.impure.lisp +++ b/tests/backq.impure.lisp @@ -57,6 +57,10 @@ (let ((string "`(foobar a b ,c ,'(e f g) d ,@'(e f g) (h i j) ,@foo)")) (assert (equal (print (read-from-string string)) (read-from-string string)))) + +(let ((a '`(1 ,@a ,@b ,.c ,.d))) + (let ((*print-circle* t)) + (assert (equal (read-from-string (write-to-string a)) a)))) ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index c55cc11..140f453 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.19.23" +"0.8.19.24" -- 1.7.10.4