Thanks to Tobias Rittweiler.
* enhancement: dynamic-extent support has been extended to support
cases where there are multiple possible sources for the stack
allocated value.
+ * bug fix: symbol-macro expansion now uses the *MACROEXPAND-HOOK*
+ as specified by the CLHS. (thanks to Tobias Rittweiler)
changes in sbcl-1.0.10 relative to sbcl-1.0.9:
* minor incompatible change: the MSI installer on Windows no longer
t)
(values form nil))))
((symbolp form)
- (let* ((venv (when env (sb!c::lexenv-vars env)))
- (local-def (cdr (assoc form venv))))
- (cond ((and (consp local-def)
- (eq (car local-def) 'macro))
- (values (cdr local-def) t))
- (local-def
- (values form nil))
- ((eq (info :variable :kind form) :macro)
- (values (info :variable :macro-expansion form) t))
- (t
- (values form nil)))))
+ (flet ((perform-symbol-expansion (symbol expansion)
+ ;; CLHS 3.1.2.1.1 specifies that symbol-macros are expanded
+ ;; via the macroexpand hook, too.
+ (funcall sb!xc:*macroexpand-hook*
+ (constantly expansion)
+ symbol
+ env)))
+ (let* ((venv (when env (sb!c::lexenv-vars env)))
+ (local-def (cdr (assoc form venv))))
+ (cond ((and (consp local-def)
+ (eq (car local-def) 'macro))
+ (values (perform-symbol-expansion form (cdr local-def)) t))
+ (local-def
+ (values form nil))
+ ((eq (info :variable :kind form) :macro)
+ (let ((expansion (info :variable :macro-expansion form)))
+ (values (perform-symbol-expansion form expansion) t)))
+ (t
+ (values form nil))))))
(t
(values form nil))))
(assert (null glob))
(assert (equal (let ((glob nil)) (push 'foo glob) glob) '(foo)))
(assert (null glob))
+
+
+
+;;; CLHS 3.1.2.1.1 specifies that symbol macro expansion must also
+;;; go through *MACROEXPAND-HOOK*. (2007-09-22, -TCR.)
+
+(define-symbol-macro .foo. 'foobar)
+
+(let* ((expanded-p nil)
+ (*macroexpand-hook* #'(lambda (fn form env)
+ (when (eq form '.foo.)
+ (setq expanded-p t))
+ (funcall fn form env))))
+ (multiple-value-bind (expansion flag) (macroexpand '.foo.)
+ (assert (equal expansion '(quote foobar)))
+ (assert flag)
+ (assert expanded-p)))
+
+(let ((sb-ext::*evaluator-mode* :interpret))
+ (let* ((expanded-p nil)
+ (*macroexpand-hook* #'(lambda (fn form env)
+ (when (eq form '.foo.)
+ (setq expanded-p t))
+ (funcall fn form env))))
+ (eval '.foo.)
+ (assert expanded-p)))
+
+(let* ((expanded-p nil)
+ (*macroexpand-hook* #'(lambda (fn form env)
+ (when (eq form '/foo/)
+ (setq expanded-p t))
+ (funcall fn form env))))
+ (compile nil '(lambda ()
+ (symbol-macrolet ((/foo/ 'foobar))
+ (macrolet ((expand (symbol &environment env)
+ (macroexpand symbol env)))
+ (expand /foo/)))))
+ (assert expanded-p))
;;; 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.10.8"
+"1.0.10.9"