Next Prev Up Top Contents Index

declare

Special Form
Summary

Declares a variable as special, or provides advice to the Common Lisp system.

Package

common-lisp

Signature

declare declaration *

Arguments

declaration

A declaration specifier, not evaluated.

Values

The special form declare behaves computationally as if it is not present (other than to affect the semantics), and is only allowed in certain contexts, such as after the variable list in a let , do , defun , etc.

(Consult the syntax definition of each special form to see if it takes declare forms and/or documentation strings.)

Description

There are two distinct uses of declare : one is to declare Lisp variables as "special" (this affects the semantics of the appropriate bindings of the variables), and the other is to provide advice to help the Common Lisp system (in reality the compiler) run your Lisp code faster, or with more sophisticated debugging options.

Notes

Note the following LispWorks extensions to the Common Lisp definition of declare :

lambda-list specifies the value to be returned when a programmer asks for the arglist of a function

values specifies the value to be returned when you ask for a description of the results of a function

invisible-frame specifies that calls to this function should not appear in a debugger backtrace

alias specifies that calls to this function should be displayed as calls to an alternative function in a debugger backtrace

If you use declare to specify types (and so turn off type-checking for the specified symbols) and then supply the wrong type, you may obtain a "Segmentation Violation". You can check this by interpreting the code (rather than compiling it).

See also
compile
compile-file
proclaim

LispWorks Reference Manual - 13 Jun 2003

Next Prev Up Top Contents Index