Next Previous Up Top Contents Index

4 The COMMON-LISP Package

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 formdeclare 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 alet,do,defun, etc.
(Consult the syntax definition of each special form to see if it takesdeclare forms and/or documentation strings.)
Description

There are two distinct uses ofdeclare: 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 usedeclare 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 - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker