From 0728e7b99692f32f23ba63be90c56f4a3358e692 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 8 Mar 2004 21:59:47 +0000 Subject: [PATCH] 0.8.8.19: Fix for *PRINT-CASE* :CAPITALIZE and word determination (see CLHS *PRINT-CASE* and STRING-CAPITALIZE) ... also note unpleasant discovery about lack of threadsafety in the printer --- NEWS | 3 +++ doc/internals-notes/threading-specials | 6 +++--- src/code/print.lisp | 8 ++++---- version.lisp-expr | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 5508258..ea00cd5 100644 --- a/NEWS +++ b/NEWS @@ -2342,6 +2342,9 @@ changes in sbcl-0.8.9 relative to sbcl-0.8.8: have been read to end-of-file. ** CLOSE works as expected on the null CONCATENATED-STREAM, and on STRING-STREAMS. + ** Printing symbols with *PRINT-CASE* :CAPITALIZE respects the + description of determination of which consecutive characters + constitute a word. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/doc/internals-notes/threading-specials b/doc/internals-notes/threading-specials index aa583b6..adfe42c 100644 --- a/doc/internals-notes/threading-specials +++ b/doc/internals-notes/threading-specials @@ -1053,7 +1053,7 @@ SB-IMPL::*AVAILABLE-BUFFERS* SB-IMPL::*BQ-DOT-FLAG* ; readonly SB-IMPL::*CIRCULARITY-COUNTER* SB-IMPL::*DIGITS* -SB-IMPL::*PREVIOUS-READTABLE-CASE* +SB-IMPL::*PREVIOUS-READTABLE-CASE* ; FIXME: printer not threadsafe SB-IMPL::*BQ-VECTOR-FLAG* ; readonly SB-IMPL::*ABBREV-WEEKDAY-TABLE* SB-IMPL::*LOGICAL-HOSTS* @@ -1066,7 +1066,7 @@ SB-IMPL::*VALID-FUN-NAMES-ALIST* SB-IMPL::*PERIODIC-POLLING-FUNCTION* SB-IMPL::*ABORTED-COMPILATION-UNIT-COUNT* SB-IMPL::*LONG-WEEKDAY-TABLE* -SB-IMPL::*INTERNAL-SYMBOL-OUTPUT-FUN* +SB-IMPL::*INTERNAL-SYMBOL-OUTPUT-FUN* ; FIXME: printer not threadsafe SB-IMPL::*BACKQUOTE-COUNT* ; bound SB-IMPL::*DIGIT-BASES* SB-IMPL::*PREVIOUS-DRIBBLE-STREAMS* @@ -1083,7 +1083,7 @@ SB-IMPL::*MACHINE-VERSION* ; unset/unbound ? are we using this? SB-IMPL::*IGNORE-WILDCARDS* SB-IMPL::*INCH-PTR* SB-IMPL::*SHARP-EQUAL-ALIST* -SB-IMPL::*PREVIOUS-CASE* +SB-IMPL::*PREVIOUS-CASE* ; FIXME: printer not threadsafe *INLINE-EXPANSION-LIMIT* *DERIVE-FUNCTION-TYPES* diff --git a/src/code/print.lisp b/src/code/print.lisp index 0989d83..9682372 100644 --- a/src/code/print.lisp +++ b/src/code/print.lisp @@ -875,19 +875,19 @@ ;;; :DOWNCASE :CAPITALIZE (defun output-capitalize-symbol (pname stream) (declare (simple-string pname)) - (let ((prev-not-alpha t) + (let ((prev-not-alphanum t) (up (eq (readtable-case *readtable*) :upcase))) (dotimes (i (length pname)) (let ((char (char pname i))) (write-char (if up - (if (or prev-not-alpha (lower-case-p char)) + (if (or prev-not-alphanum (lower-case-p char)) char (char-downcase char)) - (if prev-not-alpha + (if prev-not-alphanum (char-upcase char) char)) stream) - (setq prev-not-alpha (not (alpha-char-p char))))))) + (setq prev-not-alphanum (not (alphanumericp char))))))) ;;; called when: ;;; READTABLE-CASE *PRINT-CASE* diff --git a/version.lisp-expr b/version.lisp-expr index 479d5ba..a64e60f 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.8.18" +"0.8.8.19" -- 1.7.10.4