1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/f_procla.htm
2024-04-01 10:24:07 +02:00

82 lines
6.8 KiB
HTML

<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Function PROCLAIM</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="v_mexp_h.htm">
<LINK REL=UP HREF="c_evalua.htm">
<LINK REL=NEXT HREF="m_declai.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="v_mexp_h.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_evalua.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="m_declai.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<A NAME="proclaim"><I>Function</I> <B>PROCLAIM</B></A> <P>
<P><B>Syntax:</B><P>
<P>
<B>proclaim</B> <I>declaration-specifier</I> =&gt; <I><A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A></I><P>
<P>
<P><B>Arguments and Values:</B><P>
<P>
<I>declaration-specifier</I>---a <A REL=DEFINITION HREF="26_glo_d.htm#declaration_specifier"><I>declaration specifier</I></A>. <P>
<P><B>Description:</B><P>
<P>
<A REL=DEFINITION HREF="26_glo_e.htm#establish"><I>Establishes</I></A> the <A REL=DEFINITION HREF="26_glo_d.htm#declaration"><I>declaration</I></A> specified by <I>declaration-specifier</I> in the <A REL=DEFINITION HREF="26_glo_g.htm#global_environment"><I>global environment</I></A>. <P>
Such a <A REL=DEFINITION HREF="26_glo_d.htm#declaration"><I>declaration</I></A>, sometimes called a <A REL=DEFINITION HREF="26_glo_g.htm#global_declaration"><I>global declaration</I></A> or a <A REL=DEFINITION HREF="26_glo_p.htm#proclamation"><I>proclamation</I></A>, is always in force unless locally <I>shadowed</I>. <P>
<A REL=DEFINITION HREF="26_glo_n.htm#name"><I>Names</I></A> of <A REL=DEFINITION HREF="26_glo_v.htm#variable"><I>variables</I></A> and <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>functions</I></A> within <I>declaration-specifier</I> refer to <A REL=DEFINITION HREF="26_glo_d.htm#dynamic_variable"><I>dynamic variables</I></A> and global <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> definitions, respectively. <P>
The next figure shows a list of <I>declaration identifiers</I> that can be used with <A REL=DEFINITION HREF="#proclaim"><B>proclaim</B></A>. <P>
<PRE>
<A REL=DEFINITION HREF="d_declar.htm#declaration">declaration</A> <A REL=DEFINITION HREF="d_inline.htm#inline">inline</A> <A REL=DEFINITION HREF="d_optimi.htm#optimize">optimize</A> <A REL=DEFINITION HREF="a_type.htm#type">type</A>
<A REL=DEFINITION HREF="d_ftype.htm#ftype">ftype</A> <A REL=DEFINITION HREF="d_inline.htm#notinline">notinline</A> <A REL=DEFINITION HREF="d_specia.htm#special">special</A>
</PRE>
<P><B>Figure 3-22. Global Declaration Specifiers</B> <P>
An implementation is free to support other (<A REL=DEFINITION HREF="26_glo_i.htm#implementation-defined"><I>implementation-defined</I></A>) <A REL=DEFINITION HREF="26_glo_d.htm#declaration_identifier"><I>declaration identifiers</I></A> as well. <P>
<P><B>Examples:</B><P>
<P>
<PRE>
(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*))
=&gt; FLOAT
</PRE>
</TT> <P>
<P><B>Affected By:</B> None.
<P>
<P><B>Exceptional Situations:</B> None.
<P>
<P><B>See Also:</B><P>
<P>
<A REL=DEFINITION HREF="m_declai.htm#declaim"><B>declaim</B></A>, <A REL=DEFINITION HREF="s_declar.htm#declare"><B>declare</B></A>, <A REL=CHILD HREF="03_b.htm">Section 3.2 (Compilation)</A> <P>
<P><B>Notes:</B><P>
<P>
Although the <I>execution</I> of a <A REL=DEFINITION HREF="#proclaim"><B>proclaim</B></A> <A REL=DEFINITION HREF="26_glo_f.htm#form"><I>form</I></A> has effects that might affect compilation, the compiler does not make any attempt to recognize and specially process <A REL=DEFINITION HREF="#proclaim"><B>proclaim</B></A> <A REL=DEFINITION HREF="26_glo_f.htm#form"><I>forms</I></A>. A <A REL=DEFINITION HREF="26_glo_p.htm#proclamation"><I>proclamation</I></A> such as the following, even if a <A REL=DEFINITION HREF="26_glo_t.htm#top_level_form"><I>top level form</I></A>, does not have any effect until it is executed: <P>
<PRE>
(proclaim '(special *x*))
</PRE>
</TT> <P>
If compile time side effects are desired, <A REL=DEFINITION HREF="s_eval_w.htm#eval-when"><B>eval-when</B></A> may be useful. For example: <P>
<PRE>
(eval-when (:execute :compile-toplevel :load-toplevel)
(proclaim '(special *x*)))
</PRE>
</TT> <P>
In most such cases, however, it is preferrable to use <A REL=DEFINITION HREF="m_declai.htm#declaim"><B>declaim</B></A> for this purpose. <P>
Since <A REL=DEFINITION HREF="#proclaim"><B>proclaim</B></A> <A REL=DEFINITION HREF="26_glo_f.htm#form"><I>forms</I></A> are ordinary <A REL=DEFINITION HREF="26_glo_f.htm#function_form"><I>function forms</I></A>, <A REL=DEFINITION HREF="26_glo_m.htm#macro_form"><I>macro forms</I></A> can expand into them. <P>
<P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issues</A>, <I>not part of the specification</I>, apply to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss095.htm">DECLARE-MACROS:FLUSH</A><LI> <A REL=CHILD HREF="../Issues/iss094.htm">DECLARE-FUNCTION-AMBIGUITY:DELETE-FTYPE-ABBREVIATION</A><LI> <A REL=CHILD HREF="../Issues/iss142.htm">DYNAMIC-EXTENT:NEW-DECLARATION</A><P></UL><HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>