Skip to content
Snippets Groups Projects
Commit d2dcf0fa authored by cshapiro's avatar cshapiro
Browse files

When attempting to macro expand a symbol that denotes a local

definition, if the symbol is symbol macro, return the expansion.
Otherwise, if the symbol is a local definition but not a symbol macro,
return the symbol and report no expansion.  Previously, the otherwise
case was not handled and macroexpand-1 fell through in error to test
forms for global cases.  Among other things, this caused the expansion
of global symbol macros shadowed by lexical variable bindings.
parent 896812b8
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/eval.lisp,v 1.42 2005/07/13 17:19:33 rtoy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/eval.lisp,v 1.43 2006/12/19 10:50:57 cshapiro Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -401,9 +401,10 @@ ...@@ -401,9 +401,10 @@
((symbolp form) ((symbolp form)
(let* ((venv (when env (c::lexenv-variables env))) (let* ((venv (when env (c::lexenv-variables env)))
(local-def (cdr (assoc form venv)))) (local-def (cdr (assoc form venv))))
(cond ((and (consp local-def) (cond (local-def
(eq (car local-def) 'macro)) (if (and (consp local-def) (eq (car local-def) 'macro))
(values (cdr local-def) t)) (values (cdr local-def) t)
(values form nil)))
((eq (info variable kind form) :macro) ((eq (info variable kind form) :macro)
(values (info variable macro-expansion form) t)) (values (info variable macro-expansion form) t))
(t (t
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment