next up previous contents
Next: Declarations Up: Improvements in Common Previous: Control Structure

Macros

Macros can now be defined to use the &environmentenvironment, &wholewhole and &bodybody lambda list keywords. The functions macroexpand  and macroexpand-1  accept an optional environment argument, which should only be an environment captured with an &environmentenvironment argument to a macro or an environment passed to an evalhook function. Expansion is done using this environment if supplied; otherwise, the null environment is used.

Macros allow destructuring in their required arguments, not in any other arguments. The macro destructuring-bind  is also available. The &wholewhole lambda keyword may not be used in this macro. Steele [7] says it may, but I think this is an error.

The define-compiler-macro  macro is available for defining macros to be expanded only at compile time.

The function macro-function  is available. Macros have been modified to use a macro function of two arguments, the form to be expanded and the environment. macro-function  returns this function when its symbol argument names a macro.

The functions variable-information  and function-information  for accessing environment information and augment-environment  for changing environment information have been added. The functions parse-macro  and enclose  are also available.

A simple implementation of symbol-macrolet  has been added. It has not been extensively tested. It is currently not part of the standard initial workspace but set up to be autoloaded when called. Code using symbol-macrolet  will be completely macro expanded, which means some standard macros implemented as special forms in the interpreter will be replaced by macros and expanded. The code may therefore be a bit slow when interpreted, but speed of compiled code will not suffer.



Luke Tierney
Wed Feb 26 05:25:18 CST 1997