383 lines
No EOL
8.5 KiB
HTML
383 lines
No EOL
8.5 KiB
HTML
<!DOCTYPE HTML>
|
|
<HTML LANG="en-us"
|
|
><HEAD
|
|
><TITLE
|
|
>proclaim | Common Lisp Nova Spec</TITLE
|
|
><META CHARSET="US-ASCII"
|
|
><LINK REL="canonical" HREF="f_proclaim.html"
|
|
><LINK REL="next" HREF="f_declaim.html" TYPE="text/html" TITLE="declaim"
|
|
><LINK REL="prev" HREF="v_macroexpand-hook.html" TYPE="text/html" TITLE="*macroexpand-hook*"
|
|
><LINK REL="up" HREF="3_8_Evaluation_and_Compilation_Dictionary.html" TYPE="text/html" TITLE="3.8 Evaluation and Compilation Dictionary"
|
|
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
|
|
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
|
|
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
|
|
><SCRIPT SRC="dpans.js%3F3909942064"
|
|
></SCRIPT
|
|
><SCRIPT SRC="apropos.js%3F3909942064"
|
|
></SCRIPT
|
|
></HEAD
|
|
><BODY
|
|
><DIV
|
|
><DIV CLASS="topnav"
|
|
><DIV CLASS="breadcrumb"
|
|
><SPAN CLASS="breadcrumb-item"
|
|
><A HREF="index.html"
|
|
>Common Lisp Nova Spec</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="3_Evaluation_and_Compilation.html"
|
|
>3. Evaluation and Compilation</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="3_8_Evaluation_and_Compilation_Dictionary.html"
|
|
>3.8 Evaluation and Compilation Dictionary</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="f_proclaim.html"
|
|
>proclaim</A
|
|
></SPAN
|
|
></DIV
|
|
><DIV CLASS="apropos"
|
|
><DIV CLASS="apropos-io"
|
|
><A HREF="v_macroexpand-hook.html" CLASS="prev"
|
|
>←</A
|
|
><SPAN ID="apropos-label"
|
|
>Apropos </SPAN
|
|
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
|
|
><A HREF="f_declaim.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV ID="apropos-res"
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="matter"
|
|
><DIV CLASS="com"
|
|
><DIV CLASS="begincom"
|
|
><HR
|
|
><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0"
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" WIDTH="100%" CLASS="name"
|
|
><SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="proclaim"
|
|
></SPAN
|
|
><B
|
|
>proclaim</B
|
|
></TD
|
|
><TD ALIGN="RIGHT" VALIGN="BASELINE" WIDTH="0" NOWRAP="NOWRAP" CLASS="ftype"
|
|
><I
|
|
>Function</I
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
></DIV
|
|
><UL CLASS="subtoc"
|
|
></UL
|
|
><DL
|
|
><DT
|
|
><B
|
|
>Syntax</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><B
|
|
>proclaim</B
|
|
> <SPAN CLASS="cmssi"
|
|
>declaration-specifier</SPAN
|
|
> <SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
> <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
></P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Arguments and Values</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>declaration-specifier</VAR
|
|
> — a <A HREF="26_1_Glossary.html#declaration_specifier"
|
|
><EM CLASS="term"
|
|
>declaration specifier</EM
|
|
></A
|
|
>.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Description</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#establish"
|
|
><EM CLASS="term"
|
|
>Establishes</EM
|
|
></A
|
|
> the <A HREF="26_1_Glossary.html#declaration"
|
|
><EM CLASS="term"
|
|
>declaration</EM
|
|
></A
|
|
> specified by <VAR CLASS="param"
|
|
>declaration-specifier</VAR
|
|
> in the <A HREF="26_1_Glossary.html#global_environment"
|
|
><EM CLASS="term"
|
|
>global environment</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
>Such a <A HREF="26_1_Glossary.html#declaration"
|
|
><EM CLASS="term"
|
|
>declaration</EM
|
|
></A
|
|
>, sometimes called a <A HREF="26_1_Glossary.html#global_declaration"
|
|
><EM CLASS="term"
|
|
>global declaration</EM
|
|
></A
|
|
> or a <A HREF="26_1_Glossary.html#proclamation"
|
|
><EM CLASS="term"
|
|
>proclamation</EM
|
|
></A
|
|
>, is always in force unless locally <A HREF="26_1_Glossary.html#shadow"
|
|
><EM CLASS="term"
|
|
>shadowed</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#name"
|
|
><EM CLASS="term"
|
|
>Names</EM
|
|
></A
|
|
> of <A HREF="26_1_Glossary.html#variable"
|
|
><EM CLASS="term"
|
|
>variables</EM
|
|
></A
|
|
> and <A HREF="26_1_Glossary.html#function"
|
|
><EM CLASS="term"
|
|
>functions</EM
|
|
></A
|
|
> within <VAR CLASS="param"
|
|
>declaration-specifier</VAR
|
|
> refer to <A HREF="26_1_Glossary.html#dynamic_variable"
|
|
><EM CLASS="term"
|
|
>dynamic variables</EM
|
|
></A
|
|
> and global <A HREF="26_1_Glossary.html#function"
|
|
><EM CLASS="term"
|
|
>function</EM
|
|
></A
|
|
> definitions, respectively. </P
|
|
><P CLASS="j"
|
|
>Figure 3–22 shows a list of <VAR CLASS="param"
|
|
>declaration identifiers</VAR
|
|
> that can be used with <A HREF="f_proclaim.html" CLASS="funref"
|
|
><B
|
|
>proclaim</B
|
|
></A
|
|
>.</P
|
|
><FIGURE CLASS="boxfig"
|
|
><DIV CLASS="figbody"
|
|
><TABLE CELLSPACING="0" CELLPADDING="0" RULES="GROUPS" STYLE="margin: 1ex 0" WIDTH="100%"
|
|
><TBODY
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE=";padding-right:3px"
|
|
><A HREF="m_declaration.html" CLASS="misc"
|
|
><B
|
|
>declaration</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE="padding-left:3px;padding-right:3px"
|
|
> <A HREF="m_inline.html" CLASS="misc"
|
|
><B
|
|
>inline</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE="padding-left:3px;padding-right:3px"
|
|
> <A HREF="m_optimize.html" CLASS="misc"
|
|
><B
|
|
>optimize</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE="padding-left:3px;"
|
|
> <A HREF="m_type.html" CLASS="misc"
|
|
><B
|
|
>type</B
|
|
></A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE=";padding-right:3px"
|
|
> <A HREF="m_ftype.html" CLASS="misc"
|
|
><B
|
|
>ftype</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE="padding-left:3px;padding-right:3px"
|
|
> <A HREF="m_inline.html" CLASS="misc"
|
|
><B
|
|
>notinline</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE="padding-left:3px;padding-right:3px"
|
|
> <A HREF="m_special.html" CLASS="misc"
|
|
><B
|
|
>special</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" STYLE="padding-left:3px;"
|
|
><SPAN CLASS="misc"
|
|
></SPAN
|
|
></TD
|
|
></TR
|
|
></TBODY
|
|
></TABLE
|
|
></DIV
|
|
><FIGCAPTION CLASS="caption"
|
|
><B
|
|
>Figure 3–22. Global Declaration Specifiers</B
|
|
></FIGCAPTION
|
|
></FIGURE
|
|
><P CLASS="j"
|
|
>An implementation is free to support other (<A HREF="26_1_Glossary.html#implementation-defined"
|
|
><EM CLASS="term"
|
|
>implementation-defined</EM
|
|
></A
|
|
>) <A HREF="26_1_Glossary.html#declaration_identifier"
|
|
><EM CLASS="term"
|
|
>declaration identifiers</EM
|
|
></A
|
|
> as well.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Examples</B
|
|
></DT
|
|
><DD
|
|
><PRE CLASS="screen"
|
|
> (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*))
|
|
<SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> FLOAT</PRE
|
|
></DD
|
|
><DT
|
|
><B
|
|
>See Also</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><A HREF="f_declaim.html" CLASS="macref"
|
|
><B
|
|
>declaim</B
|
|
></A
|
|
>, <A HREF="m_declare.html" CLASS="misc"
|
|
><B
|
|
>declare</B
|
|
></A
|
|
>, <A HREF="3_2_Compilation.html#sec_3_2" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>3.2</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Compilation)</SPAN
|
|
></A
|
|
></P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Notes</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
>Although the <EM CLASS="term"
|
|
>execution</EM
|
|
> of a <A HREF="f_proclaim.html" CLASS="funref"
|
|
><B
|
|
>proclaim</B
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#form"
|
|
><EM CLASS="term"
|
|
>form</EM
|
|
></A
|
|
> has effects that might affect compilation, the compiler does not make any attempt to recognize and specially process <A HREF="f_proclaim.html" CLASS="funref"
|
|
><B
|
|
>proclaim</B
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#form"
|
|
><EM CLASS="term"
|
|
>forms</EM
|
|
></A
|
|
>. A <A HREF="26_1_Glossary.html#proclamation"
|
|
><EM CLASS="term"
|
|
>proclamation</EM
|
|
></A
|
|
> such as the following, even if a <A HREF="26_1_Glossary.html#top_level_form"
|
|
><EM CLASS="term"
|
|
>top level form</EM
|
|
></A
|
|
>, does not have any effect until it is executed:</P
|
|
><PRE CLASS="screen"
|
|
>(proclaim '(special *x*))</PRE
|
|
><P CLASS="j"
|
|
>If compile time side effects are desired, <A HREF="f_eval-when.html" CLASS="specref"
|
|
><B
|
|
>eval-when</B
|
|
></A
|
|
> may be useful. For example:</P
|
|
><PRE CLASS="screen"
|
|
>(eval-when (:execute :compile-toplevel :load-toplevel)
|
|
(proclaim '(special *x*)))</PRE
|
|
><P CLASS="j"
|
|
>In most such cases, however, it is preferrable to use <A HREF="f_declaim.html" CLASS="macref"
|
|
><B
|
|
>declaim</B
|
|
></A
|
|
> for this purpose. </P
|
|
><P CLASS="j"
|
|
>Since <A HREF="f_proclaim.html" CLASS="funref"
|
|
><B
|
|
>proclaim</B
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#form"
|
|
><EM CLASS="term"
|
|
>forms</EM
|
|
></A
|
|
> are ordinary <A HREF="26_1_Glossary.html#function_form"
|
|
><EM CLASS="term"
|
|
>function forms</EM
|
|
></A
|
|
>, <A HREF="26_1_Glossary.html#macro_form"
|
|
><EM CLASS="term"
|
|
>macro forms</EM
|
|
></A
|
|
> can expand into them.</P
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="footer"
|
|
><DIV CLASS="btmnav"
|
|
><A HREF="v_macroexpand-hook.html" CLASS="prev"
|
|
>←</A
|
|
><A HREF="f_declaim.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV CLASS="trail"
|
|
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
|
|
></DIV
|
|
></DIV
|
|
><SCRIPT
|
|
>domReady();</SCRIPT
|
|
></BODY
|
|
></HTML
|
|
> |