From: Douglas K. <sn...@us...> - 2014-02-05 17:53:18
|
The branch "master" has been updated in SBCL: via 5ac3b3f7e9c23c8040634b8de199848b88592eda (commit) from b352c138fbc1e28433e0fe9fcd429a6a3b265ca3 (commit) - Log ----------------------------------------------------------------- commit 5ac3b3f7e9c23c8040634b8de199848b88592eda Author: Douglas Katzman <do...@go...> Date: Wed Feb 5 12:51:18 2014 -0500 Re-fix *reader-package* inside sharp-{plus,minus} --- src/code/sharpm.lisp | 2 +- tests/reader.impure.lisp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/src/code/sharpm.lisp b/src/code/sharpm.lisp index 01f5901..a382089 100644 --- a/src/code/sharpm.lisp +++ b/src/code/sharpm.lisp @@ -355,7 +355,7 @@ (flet ((guts (stream not-p) (unless (if (let ((*package* *keyword-package*) - (*reader-package* *keyword-package*) + (*reader-package* nil) (*read-suppress* nil)) (featurep (read stream t nil t))) (not not-p) diff --git a/tests/reader.impure.lisp b/tests/reader.impure.lisp index 1db35ca..c3e71e8 100644 --- a/tests/reader.impure.lisp +++ b/tests/reader.impure.lisp @@ -175,4 +175,21 @@ (assert (eq t (set-dispatch-macro-character #\# #\~ fun nil))) (assert (eq fun (get-dispatch-macro-character #\# #\~ nil)))))) +(defun cl-user::esoteric-load-thing () + ;; This LOAD-AS-SOURCE will fail if PRINT1 reads as the keyword :PRIN1 + (let ((s (make-string-input-stream + "(cl:in-package :cl-user) (prin1 'okey-dokey)"))) + (let ((*package* *package*)) + (sb-impl::load-as-source s :print t :verbose t)))) + +(with-test (:name :reader-package-in-conditional) + ;; Sharp-plus binds *package* but not *reader-package* so that if, + ;; while reading the conditional expression itself, a read-time eval occurs + ;; expressly changing *package*, it should do whan you mean, + ;; though such usage is a little insane. + (let ((value + (read-from-string + "(#+#.(cl:progn (cl-user::esoteric-load-thing) 'sbcl) hiyya hoho)"))) + (assert (equal value '(hiyya hoho))))) + ;;; success ----------------------------------------------------------------------- hooks/post-receive -- SBCL |