From 7f029da277c068fd346c5d95303f7e4eeafbdcfc Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 3 Oct 2003 17:39:30 +0000 Subject: [PATCH] 0.8.4.7: (Not Linux) build fix ... move reference to SIG_DEQUEUE into #ifdef LISP_FEATURE_SB_THREAD Fix bug in backquote pretty-printer ... now takes care to disambiguate ,.foo and , .foo --- BUGS | 6 ------ NEWS | 2 ++ src/code/pp-backq.lisp | 13 ++++++++++++- src/runtime/thread.c | 8 ++++---- tests/pprint.impure.lisp | 14 ++++++++++++++ version.lisp-expr | 2 +- 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/BUGS b/BUGS index 688b166..0185dc7 100644 --- a/BUGS +++ b/BUGS @@ -464,12 +464,6 @@ WORKAROUND: * '``(FOO ,@',@S) ``(FOO SB-IMPL::BACKQ-COMMA-AT S) - b. - * (write '`(, .ala.) :readably t :pretty t) - `(,.ALA.) - - (note the space between the comma and the point) - 143: (reported by Jesse Bouwman 2001-10-24 through the unfortunately prominent SourceForge web/db bug tracking system, which is diff --git a/NEWS b/NEWS index 9ab2e1f..68014ed 100644 --- a/NEWS +++ b/NEWS @@ -2117,6 +2117,8 @@ changes in sbcl-0.8.5 relative to sbcl-0.8.4: * fix bug 214: algorithm for noting rejected templates is now more similar to that of template seletion. (also reported by rydis on #lisp) + * fixed bug 141b: printing backquoted information readably and prettily + inserts a space where necessary. * compiler enhancement: SIGNUM is now better able to derive the type of its result. * fixed some bugs revealed by Paul Dietz' test suite: diff --git a/src/code/pp-backq.lisp b/src/code/pp-backq.lisp index 2552673..9b2ff78 100644 --- a/src/code/pp-backq.lisp +++ b/src/code/pp-backq.lisp @@ -78,7 +78,18 @@ (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. diff --git a/src/runtime/thread.c b/src/runtime/thread.c index eb8f241..a42c26e 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -263,6 +263,10 @@ struct thread *find_thread_by_pid(pid_t pid) return 0; } +/* These are not needed unless #+SB-THREAD, and since sigwaitinfo() + * doesn't seem to be easily available everywhere (OpenBSD...) it's + * more trouble than it's worth to compile it when not needed. */ +#if defined LISP_FEATURE_SB_THREAD void block_sigcont(void) { /* don't allow ourselves to receive SIGCONT while we're in the @@ -274,10 +278,6 @@ void block_sigcont(void) sigprocmask(SIG_BLOCK, &newset, 0); } -/* This is not needed unless #+SB-THREAD, and since sigwaitinfo() - * doesn't seem to be easily available everywhere (OpenBSD...) it's - * more trouble than it's worth to compile it when not needed. */ -#if defined LISP_FEATURE_SB_THREAD void unblock_sigcont_and_sleep(void) { sigset_t set; diff --git a/tests/pprint.impure.lisp b/tests/pprint.impure.lisp index ee1f91a..8423f9f 100644 --- a/tests/pprint.impure.lisp +++ b/tests/pprint.impure.lisp @@ -88,6 +88,20 @@ ;2~%~ ;3x")))) +;;; bug 141b: not enough care taken to disambiguate ,.FOO and ,@FOO +;;; from , .FOO and , @FOO +(assert (equal + (with-output-to-string (s) + (write '`(, .foo) :stream s :pretty t :readably t)) + "`(, .FOO)")) +(assert (equal + (with-output-to-string (s) + (write '`(, @foo) :stream s :pretty t :readably t)) + "`(, @FOO)")) +(assert (equal + (with-output-to-string (s) + (write '`(, ?foo) :stream s :pretty t :readably t)) + "`(,?FOO)")) ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index a04ff04..95b6ccb 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.4.6" +"0.8.4.7" -- 1.7.10.4