Expansion time is the time at which macro and identifier macro definition values are evaluated and macro procedures are invoked. Macros, identifier macros, and primitive syntax are expansion-time values. General expansion-time values can be defined with the define-expansion-time and let-expansion-time syntactic forms, and arbitrary expressions can be evaluated at expansion time with the begin-expansion-time syntactic form. Scoped expansion-time bindings can be obtained with local-expansion-time-value.
As with define-macro, an embedded define-expansion-time expression is transformed into a let-expansion-time expression.
The begin-expansion-time form is useful for defining macro packages that can be compiled with compile-file.
The expansion-time-value? procedure returns #t if its argument is a value created with define-expansion-time or #f otherwise. Note that expansion-time-value? cannot be applied directly to expansion-time identifiers, but expansion-time values can be obtained indirectly with global-defined-value.