Skip to main content

declaration

declaration Declaration

Syntax:

(declaration {name}*)

Arguments:

name—a symbol.

Valid Context:

proclamation only

Description:

Advises the compiler that each name is a valid but potentially non-standard declaration name. The purpose of this is to tell one compiler not to issue warnings for declarations meant for another compiler or other program processor.

Examples:

(declaim (declaration author target-language target-machine)) 
(declaim (target-language ada))
(declaim (target-machine IBM-650))
(defun strangep (x)
(declare (author "Harry Tweeker"))
(member x ’(strange weird odd peculiar)))

See Also:

declaim, proclaim

Expanded Reference: declaration

Declaring Custom Declaration Identifiers

The declaration proclamation advises the system that certain names are valid declaration identifiers. This prevents warnings about unrecognized declarations.

(declaim (declaration my-author my-version))
;; Now my-author and my-version are recognized as valid declaration identifiers.

(defun foo (x)
(declare (my-author "Alice")
(my-version 2))
(* x x))
=> FOO
;; No warning about unrecognized declarations.

Using proclaim

(proclaim '(declaration my-note))
;; my-note is now a recognized declaration identifier.