From cd08dc8fd4d4b77fdbe87addb06e97cde247bbf9 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sun, 29 Apr 2007 16:19:29 +0000 Subject: [PATCH] 1.0.5.5: &ENVIRONMENT fixes * Place the binding for &ENVIRONMENT in the correct scope for ignore declarations. * Place the local-decls return value from PARSE-DEFMACRO in the right scope in DEFSETF. * Tests. --- NEWS | 4 ++++ src/code/early-setf.lisp | 3 +-- src/code/parse-defmacro.lisp | 8 ++++---- tests/compiler.impure.lisp | 10 ++++++++++ tests/setf.impure.lisp | 9 +++++++++ version.lisp-expr | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index bf72037..f565ca5 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ changes in sbcl-1.0.6 relative to sbcl-1.0.5: * bug fix: GC race condition occasionally resulting in crashes with the error message "SIG_STOP_FOR_GC blocked at a bad place" has been fixed. + * bug fix: &ENVIRONMENT variables in macro lambda lists can now be + declared ignored. + * bug fix: DEFSETF lambda lists without &ENVIRONMENT no longer cause + a STYLE-WARNING to be signalled (regression from 1.0.4.) changes in sbcl-1.0.5 relative to sbcl-1.0.4: * incompatible change: removed writer methods for host-ent-name, diff --git a/src/code/early-setf.lisp b/src/code/early-setf.lisp index 0f63965..d184133 100644 --- a/src/code/early-setf.lisp +++ b/src/code/early-setf.lisp @@ -405,10 +405,9 @@ GET-SETF-EXPANSION directly." (assign-setf-macro ',access-fn (lambda (,access-form-var ,env-var) - (declare (ignorable ,env-var)) + ,@local-decs (%defsetf ,access-form-var ,(length store-variables) (lambda (,whole-var) - ,@local-decs ,body))) nil ',doc)))))) diff --git a/src/code/parse-defmacro.lisp b/src/code/parse-defmacro.lisp index eea2801..fe30d12 100644 --- a/src/code/parse-defmacro.lisp +++ b/src/code/parse-defmacro.lisp @@ -50,13 +50,13 @@ (parse-defmacro-lambda-list lambda-list whole-var name context :error-fun error-fun :anonymousp anonymousp) - (values `(let* (,@(when env-arg-used - `((,*env-var* ,env-arg-name))) - ,@(nreverse *system-lets*)) + (values `(let* (,@(nreverse *system-lets*)) ,@(when *ignorable-vars* `((declare (ignorable ,@*ignorable-vars*)))) ,@*arg-tests* - (let* ,(nreverse *user-lets*) + (let* (,@(when env-arg-used + `((,*env-var* ,env-arg-name))) + ,@(nreverse *user-lets*)) ,@declarations ,@(if wrap-block `((block ,(fun-name-block-name name) diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 6b01a47..4dd6b02 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1416,4 +1416,14 @@ (program-error () :ok)))) +;;; ignore &environment +(handler-bind ((style-warning #'error)) + (compile nil '(lambda () + (defmacro macro-ignore-env (&environment env) + (declare (ignore env)) + :foo))) + (compile nil '(lambda () + (defmacro macro-no-env () + :foo)))) + ;;; success diff --git a/tests/setf.impure.lisp b/tests/setf.impure.lisp index 0867029..0b8a867 100644 --- a/tests/setf.impure.lisp +++ b/tests/setf.impure.lisp @@ -81,4 +81,13 @@ (error () :error)))) +(handler-bind ((style-warning #'error)) + (compile nil '(lambda () + (defsetf test-defsetf-no-env (foo) (new) + `(set-foo ,foo ,new)))) + (compile nil '(lambda () + (defsetf test-defsetf-ignore-env (foo &environment env) (new) + (declare (ignore env)) + `(set-foo ,foo ,new))))) + ;;; success diff --git a/version.lisp-expr b/version.lisp-expr index 3da9d7f..76560d8 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".) -"1.0.5.4" +"1.0.5.5" -- 1.7.10.4