MACRO-FUNCTION-ENVIRONMENTENVIRONMENT argument to a macro-expansion function may only be used as the second argument to the functions MACROEXPAND and MACROEXPAND-1. It is sometimes more convenient, however, to be able to work directly with the more primitive function MACRO-FUNCTION, on which MACROEXPAND and MACROEXPAND-1 are presumably based. However, since MACRO-FUNCTION does not take an environment argument, it cannot be used in situations in which that environment must be taken into account.MACRO-FUNCTION, that argument being an environment that was passed as the &ENVIRONMENT argument to some macro expansion function. If the argument is not given, or the argument is NIL, the null environment is used. MACRO-FUNCTION will now consider macro definitions from that environment in preference to ones in the global environment. It is an error to supply the environment argument in a use of MACRO-FUNCTION as a SETF location specifier.:beep)) (foo))))
=> (no yes)
(setf (macro-function 'bar env) ...) is an error.
MACRO-FUNCTION, not MACROEXPAND or MACROEXPAND-1, yet the environment argument can only be supplied to the latter functions and not to the former one. By changing this state of affairs, the model of macro expansion becomes somewhat simpler. Also, more flexible use of the facility is enabled.MACROEXPAND-1 to MACRO-FUNCTION.