[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
macroexpand inside of macrolet...
I was playing around inside some macrolet code and came across
what seems to a be a problem (if this issue was discussed ages ago
on this mailing list, please pardon me for raising it again).
(MACROLET ((CONS (A B) `(LIST ',A ',B)))
(MACROEXPAND '(CONS 1 2)))
returns (CONS 1 2) and NIL, while
(MACROLET ((CONS (A B) `(LIST ',A ',B)))
#'CONS)
blows up since FUNCTION sees the local macro definition.
Getting a handle on the local macro environment seems to be
next to impossible. Is there some good reason for this?
Should function be paying attention to the MACROLET
environment in the same way as it does for FLET/LABELS or is
this a bug in my implementation?
Does anyone out there agree with the idea that
macroexpanding something inside the body of a macrolet
is a useful thing to do?
From a debugging standpoint, the current situation
makes it difficult to see what is going on since
there is no "defined" way to see what is currently
defined and of course using something like #'FOO
is ok except if FOO is a macrolet creation.
I suggest the following:
(1) Either MACRO-FUNCTION should be changed to notice
the local macro or some new function be defined
for getting at the local macro environment.
(2) Either MACROEXPAND should by default use the
current environment (implementation specific of
course!) or a new function should be defined
for doing the same thing or perhaps the time
has arrived for a way to access the environment
in a general way.
Comments?
--David
p.s. This whole bag of %&$# would go away if macrolet were
to vaporize itself from the language.