next up previous contents index
Next: Undefined Warnings Up: The Compiler Previous: Calling the Compiler   Contents   Index


Compilation Units

units

CMU Common Lisp supports the with-compilation-unit macro added to the language by the proposed X3J13 ``with-compilation-unit'' compiler cleanup. 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.

[Macro]
with-compilation-unit
($\,\{$$\}^*\,$key value) $\,\{$$\}^*\,$form

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:

:override
If 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.

:optimize
This is a CMU 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))
See section optimize-declaration

:optimize-interface
Similar to :optimize, but specifies the compilation policy for function interfaces (argument count and type checking) for the dynamic extent of the body. See section optimize-interface-declaration.

:context-declarations
This is a CMU extension that pattern-matches on function names, automatically splicing in any appropriate declarations at the head of the function definition. See section context-declarations.



Subsections
next up previous contents index
Next: Undefined Warnings Up: The Compiler Previous: Calling the Compiler   Contents   Index
Peter Van Eynde 2000-02-08