[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue MACRO-FUNCTION-ENVIRONMENT, v1



> Date: Tue, 3 Jan 89 08:10:38 pst
> From: Eric Benson <eb@lucid.com>
>
> MACRO-FUNCTION should not accept the environment argument received by
> an *EVALHOOK* or *APPLYHOOK* function.  (*APPLYHOOK* should not even
> receive an environment argument, was there ever a cleanup issue
> addressing this?)

I want MACRO-FUNCTION to accept these so that MACROEXPAND (which does) can
simply pass such objects along to MACRO-FUNCTION.  My expectation is that
MACRO-FUNCTION (or the underlying mechanism it is based on) will look at this
thing and say "nope, not a compiler environment, lets go look in the current
function cell (or wherever the implementation puts macro expander functions)".

Yes, if APPLYHOOK has been "cleaned up" then references to it should be removed
 from this proposal.

> In that case, what does MACRO-FUNCTION return when there is a MACROLET
> definition visible?  It must return some non-NIL value.  It should be
> the expansion function, to be consistent with the global case.

Right, it should be an expander function.  I don't have any really strong
preference for whether it actually "looks inside" the environment object to see
if there are any local definitions (macro or function).  I mostly proposed it
work that way so that it stayed compatible with CLtL's description, which only
talks about global definitions.  Of course, CLtL doesn't have it taking an
environment argument, so maybe I goofed here.  However, as I mentioned in the
discussion, MACRO-FUNCTION is primarily used as a predicate and a place for
SETF.  Does anybody outside of MACROEXPAND actually use the returned expander
function? 

kab
-------