Next: , Previous: , Up: The Compiler   [Contents][Index]


4.3 Compilation Units

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.

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 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))
    

See 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 The Optimize-Interface Declaration.

:context-declarations

This 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.


Next: Interpreting Error Messages, Previous: Calling the Compiler, Up: The Compiler   [Contents][Index]