next up previous contents
Next: 4.3.1 Undefined Warnings Up: 4 The Compiler Previous: 4.2 Calling the Compiler

4.3 Compilation 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 (tex2html_wrap_inline17166key valuetex2html_wrap_inline17172) tex2html_wrap_inline17166formtex2html_wrap_inline17172

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 4.7.1

: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 4.7.2.

: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 5.7.5.





Raymond Toy
Mon Jul 14 09:11:27 EDT 1997