From: Christophe Rhodes Date: Sun, 15 Jun 2003 16:21:05 +0000 (+0000) Subject: 0.8.0.72: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=12478433c6f18424c5d98f3075e3b832ad2c6ee3;p=sbcl.git 0.8.0.72: 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 --- diff --git a/NEWS b/NEWS index f25cda5..9effeae 100644 --- 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 diff --git a/src/code/reader.lisp b/src/code/reader.lisp index 49a0ba0..34a35ab 100644 --- a/src/code/reader.lisp +++ b/src/code/reader.lisp @@ -736,7 +736,8 @@ (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) @@ -956,6 +957,7 @@ (#.+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))) @@ -983,7 +985,9 @@ ;; 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)) diff --git a/tests/reader.impure.lisp b/tests/reader.impure.lisp index c3c8f4e..b71a2ee 100644 --- a/tests/reader.impure.lisp +++ b/tests/reader.impure.lisp @@ -66,5 +66,10 @@ (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) diff --git a/version.lisp-expr b/version.lisp-expr index 9668685..36e1709 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.0.71" +"0.8.0.72"