summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2013-07-20 18:17:26 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2013-07-20 18:17:26 +0200
commit557ed57e3ad0eea24977f5ee951c89e87c13bb20 (patch)
tree129cf4385d95b56fc1b8a79ac4540c74220715de
parent44feceaf16073bf8ef7f2c03d5b99eb1c4d93162 (diff)
SYMBOL-MACROLET: Signal errors on attempts to bind constants and specials.
-rw-r--r--sb-eval2.lisp12
1 files changed, 11 insertions, 1 deletions
diff --git a/sb-eval2.lisp b/sb-eval2.lisp
index 0e1e197..853ba02 100644
--- a/sb-eval2.lisp
+++ b/sb-eval2.lisp
@@ -1024,7 +1024,17 @@
(destructuring-bind (bindings &rest exprs) (rest form)
(with-parsed-body (body specials) exprs
(let ((bindings (mapcar (lambda (form)
- (cons (first form) (second form)))
+ (destructuring-bind (var macro-form) form
+ (when (or (globally-special-p var)
+ (member var specials))
+ (error 'sb-int:simple-program-error
+ :format-control "Attempt to bind a special variable with SYMBOL-MACROLET: ~S"
+ :format-arguments (list var)))
+ (when (constantp var)
+ (error 'sb-int:simple-program-error
+ :format-control "Attempt to bind a special variable with SYMBOL-MACROLET: ~S"
+ :format-arguments (list var)))
+ (cons var macro-form)))
bindings)))
(prepare-progn body
(context-add-specials