0.8.0.72:
authorChristophe Rhodes <csr21@cam.ac.uk>
Sun, 15 Jun 2003 16:21:05 +0000 (16:21 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Sun, 15 Jun 2003 16:21:05 +0000 (16:21 +0000)
Reading of symbols in a package named by "" (reported by hmot on
#lisp IRC)
... the only way one can get one of these beasts is by multiple
escapes with nothing in them, so remember if we've seen
multiple escape characters

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

diff --git a/NEWS b/NEWS
index f25cda5..9effeae 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1835,6 +1835,8 @@ changes in sbcl-0.8.1 relative to sbcl-0.8.0:
     the arguments in the correct order.  (thanks to Wolfhard Buss)
   * fixed bug 235b: compiler uses return types of MAPCAR and friends
     in type inference.  (thanks to Robert E. Brown)
+  * bug fix: reading in symbols with an explicit package name of ""
+    (e.g. '||::FOO) now works corectly.  (reported by Henrik Motakef)
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** NIL is now allowed as a structure slot name.
     ** arbitrary numbers, not just reals, are allowed in certain
index 49a0ba0..34a35ab 100644 (file)
        (colons 0)
        (possibly-rational t)
        (possibly-float t)
-       (escapes ()))
+       (escapes ())
+       (seen-multiple-escapes nil))
     (reset-read-buffer)
     (prog ((char firstchar))
       (case (char-class3 char attribute-table)
        (#.+char-attr-package-delimiter+ (go COLON))
        (t (go SYMBOL)))
       MULT-ESCAPE
+      (setq seen-multiple-escapes t)
       (do ((char (read-char stream t) (read-char stream t)))
          ((multiple-escape-p char))
        (if (escapep char) (setq char (read-char stream t)))
                ;; a FIND-PACKAGE* function analogous to INTERN*
                ;; and friends?
                (read-buffer-to-string)
-               *keyword-package*))
+               (if seen-multiple-escapes
+                   (read-buffer-to-string)
+                   *keyword-package*)))
       (reset-read-buffer)
       (setq escapes ())
       (setq char (read-char stream nil nil))
index c3c8f4e..b71a2ee 100644 (file)
             (read-from-string "#S(READABLE-STRUCT :A T)"))
            t))
 
+;;; reported by Henrik Motakef
+(defpackage "")
+(assert (eq (symbol-package (read-from-string "||::FOO"))
+           (find-package "")))
+
 ;;; success
 (quit :unix-status 104)
index 9668685..36e1709 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".)
-"0.8.0.71"
+"0.8.0.72"