《通链参考手册》


Function PROCLAIM

●语法设定:

proclaim declaration-specifier => implementation-dependent

●参数和值:

declaration-specifier---a declaration specifier.

●详情:

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 next figure shows a list of declaration identifiers that can be used with proclaim.

declaration  inline     optimize  type  
ftype        notinline  special         

■图表 3-22. Global Declaration Specifiers

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

●例子:

 (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

●受制于: 无。

●例外情况: 无。

●更多信息:

declaim, declare, Section 3.2 (Compilation)

●说明:

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 preferrable to use declaim for this purpose.

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


X3J13设计清单非标准部分,可查下面章节:


◇首页 § ◎章节目录 § □内容索引 § ○符号索引 § △术语表 § ※设计草案