All Manuals > LispWorks User Guide and Reference Manual > 33 The COMMON-LISP Package

NextPrevUpTopContentsIndex

proclaim

Function
Summary

Established a specified declaration in the global environment.

Package

common-lisp

Signature

proclaim declaration-list => nil

Arguments

declaration-list

A list of declaration forms to be put into immediate and pervasive effect.

Values

Returns nil.

Description

Unlike declare, proclaim is a function that parses the declarations in the list (usually a quoted list), and puts their semantics and advice into global effect. This can be useful when compiling a file for speedy execution, since a proclamation such as:

(proclaim '(optimize (speed 3) (space 0) (debug 0)))

means the rest of the file is compiled with these optimization levels in effect. Other ways of doing this are:

As proclaim involves parsing a list of lists of symbols and is intended to be used a few times per file at most, its implementation is not optimized for speed - it makes little sense to use it other than at top level.

Note: For a top-level call to proclaim or declaim, optimize declarations are omitted from the compiled binary file. This deviates from the ANSI Common Lisp Standard but is useful because you are unlikely to want to change settings outside of that file. To make the global settings, you can call a function which calls proclaim (so it is not a top-level call).

See Compiler control for a more extended description of the compiler optimize qualities.

Examples
(proclaim '(special *fred*))
(proclaim '(type single-float x y z))
(proclaim '(optimize (safety 0) (speed 3)))
Notes

As proclaim involves parsing a list of lists of symbols and is intended to be used a few times per file, its implementation is not optimized for speed -- it makes little sense to use it other than at top level.

Remember to quote the argument list if it is a constant list. (proclaim (special x)) attempts to call function special.

Exercise caution if you declare or proclaim variables to be special without regard to the naming convention that surrounds their names with asterisks.

See also

compile
compile-file
declaim
declare


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex