All Manuals > LispWorks® User Guide and Reference Manual > 38 The LISPWORKS Package

set-compile-file-proclaim-handling Function

Summary

Sets the way compile-file handles proclaim as a top level form.

Package

lispworks

Signature

set-compile-file-proclaim-handling value

Arguments
value
One of nil (the default), :warn, :compile-time-too, :warn-on-optimize, :ignore-optimize, :optimize-compile-time-only.
Description

The function set-compile-file-proclaim-handling tells compile-file how to handle a top level form that is a call to proclaim (a proclaim form). The meaning of value is:

nil
compile-file does not recognize a top level proclaim form specially, and hence treats it like any unknown top level form. This is the default in LispWorks 8.1 onwards, and matches the ANSI Common Lisp standard.
:compile-time-too
compile-file effectively evaluates the form both at compile time and load time, except where the declaration argument is an optimize declaration (a proclaim optimize form), in which case the form is evaluated only at compile time. This is what LispWorks did prior to version 8.1.
:warn
The same as nil, but a warning is signaled at compile time.
:warn-on-optimize
The same as nil, but a warning is signaled at compile time when it is a proclaim optimize form.
:ignore-optimize
The same as nil except that proclaim optimize forms are completely ignored and a warning is signaled at compile time.
:optimize-compile-time-only
The same as nil except for a proclaim optimize form, which is evaluated only at compile time.

With :warn-on-optimize, :ignore-optimize and :optimize-compile-time-only, a proclaim form is recognized as a proclaim optimize form only if the declaration is a quoted form starting with the symbol optimize.

Notes

A proclaim form that is not a top level form was never recognized by the compiler as special, and is not affected by this setting.

A proclaim form inside a top level eval-when form is not affected by this setting, except when (a) it is a proclaim optimize and (b) the setting is :compile-time-too and (c) the eval-when forms indicates compile time too. In this case, it is evaluated only at compile time as described above, even if the eval-when form indicates load time too, to match the behavior of LispWorks prior to version 8.1.

The :compile-time-too value makes LispWorks behave exactly like it did prior to version 8.1.

The :warn and :warn-on-optimize values make LispWorks be ANSI Common Lisp standard compliant, except the warnings.

The effects of the change between LispWorks version 8.0 and version 8.1 can be grouped in two groups:

  1. proclaim optimize forms.

    The change in LispWorks 8.1 moves the evaluation from compile time to load time. That will affect compilation of forms that follow in the same file and, after loading the file, also any compilation (both by compile-file and compile) that does not set the optimize values itself. Note also that the optimize declaration is global and affects all compilation, while other declarations are specific to the symbol(s) that they declare, and affect only code that refers to these symbols. Therefore the change for proclaim optimize forms is much more problematic, and is more difficult to detect its effects, than the change for other forms.

  2. All other proclaim forms.

    The change is that the form is not evaluated at compile time in LispWorks 8.1 (with the default setting nil), but it was evaluated at compile time in previous versions. This affects the compilation of forms that follow in the file, but not in other files. If the proclamation is needed at compile time, it should either be wrapped in eval-when or changed to use declaim.

The values :warn and :warn-on-optimize are intended to be used to find top level proclaim forms in your code, and then decide how to change these forms if necessary. You may want to change all such forms to be inside eval-when with appropriate keywords (or use declaim), and keep the setting to :warn or :warn-on-optimize.

The value :ignore-optimize can be used to prevent any optimization settings from leaking (that is changing the global optimization setting) from top level proclaim optimize forms.

The value :optimize-compile-time-only makes compile-file evaluate the proclaim optimize only at compile time, like it did prior to LispWorks 8.1, while it behaves like nil for all other proclaim forms.


LispWorks® User Guide and Reference Manual - 18 Feb 2025 15:32:27