1.0.34.3: Fix second return value of GET-MACRO-CHARACTER.
authorTobias C. Rittweiler <trittweiler@users.sourceforge.net>
Mon, 4 Jan 2010 15:55:21 +0000 (15:55 +0000)
committerTobias C. Rittweiler <trittweiler@users.sourceforge.net>
Mon, 4 Jan 2010 15:55:21 +0000 (15:55 +0000)
GET-MACRO-CHARACTER always refered to *READTABLE* when computing its
second return value (the non-terminating-p flag) rather than to the
readtable that may have been passed explicitly.

NEWS
src/code/reader.lisp
tests/reader.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index f7ea50f..fad4188 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,8 @@
 ;;;; -*- coding: utf-8; fill-column: 78 -*-
+changes relative to sbcl-1.0.34:
+  * bug fix: GET-MACRO-CHARACTER bogusly computed its second return value
+    always relative to *READTABLE* rather than the passed argument.
+
 changes in sbcl-1.0.34 relative to sbcl-1.0.33:
   * minor incompatible change: threading support is now enabled by default
     on x86[-64] Linux.
index 308d3dd..27ec01a 100644 (file)
@@ -292,8 +292,8 @@ standard Lisp readtable when NIL."
     (values fun-value
             ;; NON-TERMINATING-P return value:
             (if fun-value
-                (or (constituentp char)
-                    (not (terminating-macrop char)))
+                (or (constituentp char designated-readtable)
+                    (not (terminating-macrop char designated-readtable)))
                 ;; ANSI's definition of GET-MACRO-CHARACTER says this
                 ;; value is NIL when CHAR is not a macro character.
                 ;; I.e. this value means not just "non-terminating
index 7f88b03..a127d31 100644 (file)
       (read-from-string "CL-USER:DOES-NOT-EXIST")
     (reader-error (c)
       (princ c))))
+
+;;; The GET-MACRO-CHARACTER in SBCL <= "1.0.34.2" bogusly computed its
+;;; second return value relative to *READTABLE* rather than the passed
+;;; readtable.
+(let* ((*readtable* (copy-readtable nil)))
+  (set-syntax-from-char #\" #\A)
+  (multiple-value-bind (reader-fn non-terminating-p)
+      (get-macro-character #\" (copy-readtable nil))
+    (declare (ignore reader-fn))
+    (assert (not non-terminating-p))))
\ No newline at end of file
index f5b67bc..e8a3822 100644 (file)
@@ -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".)
-"1.0.34.2"
+"1.0.34.3"