PROCLAIM(3cl)

Common Lisp Reference

PROCLAIM(3cl)

 

NAME

proclaim – establish a declaration in the global environment (function)

SYNOPSIS

 

proclaim declaration-specifier  
implementation-dependent     
 

ARGUMENTS and VALUES

declaration-specifier —a declaration specifier.      

DESCRIPTION

Establishes the declaration specified by declaration-specifier in the global environment.    

Such a declaration, sometimes called a global declaration or a proclamation, is always in force unless locally shadowed .

Names of variables and functions within declaration-specifier refer to dynamic variables and global function definitions, respectively.

The following declaration identifiers that can be used with proclaim:  
  

declaration

notinline

type

ftype

optimize

 

inline

special

 


An implementation is free to support other (implementation-defined) declaration identifiers as well.    

AFFECTED BY

(none)    

EXCEPTIONAL SITUATIONS

(none)     

NOTES

Although the execution of a proclaim form has effects that might affect compilation, the compiler does not make any attempt to recognize and specially process proclaim forms. A proclamation such as the following, even if a top level form, does not have any effect until it is executed:

    (proclaim ’(special *x*))    

If compile time side effects are desired, eval-when may be useful. For example:

    (eval-when (:execute :compile-toplevel :load-toplevel)    
       
(proclaim ’(special *x*)))    

In most such cases, however, it is preferable to use declaim for this purpose.   

Since proclaim forms are ordinary function forms, macro forms can expand into them.      

EXAMPLES

( defun declare-variable-types-globally ( type vars )    
   
( proclaim `( type , type ,@ vars ))    
   
type )    

;; Once this form is executed, the dynamic variable *TOLERANCE*
;; must always contain a float.  
   
(declare-variable-types-globally float ’(*tolerance*))    
FLOAT     

SEE ALSO

declaim(3cl), declare(3cl),     

AUTHOR and COPYRIGHT

Substantial portions of this page are taken from draft proposed American National Standard for Information Systems—Programming Language—Common Lisp, X3J13/94-101R, Version 15.17R, Fri 12-Aug-1994 6:35pm EDT; no copyright indicated.

Additional clarification and comments by Michael Marking <marking@tatanka.com>, http://www.tatanka.com/software/cl-manpages/; alternatively, https://github.com/wakinyantanka/cl-manpages/. Copyright 2017 Michael Marking as both an original and a derivative work.

Licensed under Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0).

This page last revised Sunday 26 February 2017.