CMUCL supports the with-compilation-unit macro added to the
language by the X3J13 cleanup “with-compilation-unit”.
This provides a mechanism for eliminating spurious undefined
warnings when there are forward references across files, and also
provides a standard way to access compiler extensions.
This macro evaluates the forms in an environment that causes warnings for undefined variables, functions and types to be delayed until all the forms have been evaluated. Each keyword value is an evaluated form. These keyword options are recognized:
:overrideIf uses of with-compilation-unit are
dynamically nested, the outermost use will take precedence,
suppressing printing of undefined warnings by inner uses.
However, when the override option is true this shadowing is
inhibited; an inner use will print summary warnings for the
compilations within the inner scope.
:optimizeThis is a CMUCL extension that specifies of the
“global” compilation policy for the dynamic extent of the body.
The argument should evaluate to an optimize declare form,
like:
(optimize (speed 3) (safety 0))
:optimize-interfaceSimilar to :optimize, but
specifies the compilation policy for function interfaces (argument
count and type checking) for the dynamic extent of the body.
See The Optimize-Interface Declaration.
:context-declarationsThis is a CMUCL extension that
pattern-matches on function names, automatically splicing in any
appropriate declarations at the head of the function definition.
See :context-declarations.