The macroexpand function is the conventional means for expanding a macro call. A hook is provided for a user function to gain control during the expansion process. If form is not a macro call, then the two values form and nil are returned. A form is considered to be a macro call only if it is a cons whose car is a symbol that names a macro. Any local macro definitions established within env by macrolet will be considered.
Macro expansion is carried out as follows.
Once macroexpand-1 has determined that a symbol names a macro, it obtains the expansion function for that macro. The value returned from this call is taken to be the expansion of the macro call. Therefore its value may be a symbol, a lambda-expression, or any object of type function . The consequences are undefined if such objects are referred to outside the dynamic extent of that particular invocation of the hook function. This allows implementations to use somewhat more efficient techniques for representing environment objects.