Diff of /impnotes/eval-comp.html [000000] .. [458129] Maximize Restore

  Switch to side-by-side view

--- a
+++ b/impnotes/eval-comp.html
@@ -0,0 +1,594 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<HTML
+><HEAD
+><TITLE
+>The Evaluation and Compilation Dictionary
+  [CLHS-3.8]</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REV="MADE"
+HREF="mailto:clisp-list@sf.net"><LINK
+REL="HOME"
+TITLE="Implementation Notes for GNU CLISP."
+HREF="impnotes-top.html"><LINK
+REL="UP"
+TITLE="Evaluation and Compilation
+   [CLHS-3]"
+HREF="eval.html"><LINK
+REL="PREVIOUS"
+TITLE="Lambda Lists
+   [CLHS-3.4]"
+HREF="lalist.html"><LINK
+REL="NEXT"
+TITLE="Types and Classes
+   [CLHS-4]"
+HREF="types-classes.html"><LINK
+REL="STYLESHEET"
+TYPE="text/css"
+HREF="impnotes.css"></HEAD
+><BODY
+CLASS="section"
+BGCOLOR="#FFFFFF"
+TEXT="#000000"
+LINK="#0000FF"
+VLINK="#840084"
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Implementation Notes for <A
+HREF="http://www.gnu.org"
+TARGET="_top"
+>GNU</A
+> <A
+HREF="http://clisp.cons.org"
+TARGET="_top"
+><B
+CLASS="command"
+>CLISP</B
+></A
+>.: These notes document <A
+HREF="http://clisp.cons.org"
+TARGET="_top"
+><B
+CLASS="command"
+>CLISP</B
+></A
+> version 2.31.</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="lalist.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 3. Evaluation and Compilation
+   <A
+HREF="http://www.lisp.org/HyperSpec/Body/chap-3.html"
+TARGET="_top"
+>[CLHS-3]</A
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="types-classes.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="section"
+><H1
+CLASS="section"
+><A
+NAME="eval-comp"
+></A
+>3.5. The Evaluation and Compilation Dictionary
+  <A
+HREF="http://www.lisp.org/HyperSpec/Body/sec_the_evalu_n_dictionary.html"
+TARGET="_top"
+>[CLHS-3.8]</A
+></H1
+><DIV
+CLASS="section"
+><H2
+CLASS="section"
+><A
+NAME="spec-decl"
+></A
+>3.5.1. Declaration <A
+HREF="http://www.lisp.org/HyperSpec/Body/dec_special.html"
+TARGET="_top"
+><TT
+CLASS="literal"
+>SPECIAL</TT
+></A
+></H2
+><P
+ALIGN="justify"
+><TT
+CLASS="sexp"
+>(<A
+HREF="http://www.lisp.org/HyperSpec/Body/fun_proclaim.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>PROCLAIM</TT
+></A
+> '(<A
+HREF="http://www.lisp.org/HyperSpec/Body/dec_special.html"
+TARGET="_top"
+><TT
+CLASS="literal"
+>SPECIAL</TT
+></A
+>
+ <TT
+CLASS="replaceable"
+><I
+>variable</I
+></TT
+>))</TT
+> declarations cannot be undone.  The same holds for
+ <A
+HREF="http://www.lisp.org/HyperSpec/Body/mac_defparametercm_defvar.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>DEFVAR</TT
+></A
+>, <A
+HREF="http://www.lisp.org/HyperSpec/Body/mac_defparametercm_defvar.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>DEFPARAMETER</TT
+></A
+> and <A
+HREF="http://www.lisp.org/HyperSpec/Body/mac_defconstant.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>DEFCONSTANT</TT
+></A
+> declarations.</P
+><P
+ALIGN="justify"
+>It is an error if a <A
+HREF="http://www.lisp.org/HyperSpec/Body/mac_defconstant.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>DEFCONSTANT</TT
+></A
+> variable is bound at the moment
+ the <A
+HREF="http://www.lisp.org/HyperSpec/Body/mac_defconstant.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>DEFCONSTANT</TT
+></A
+> is executed, but <A
+HREF="http://www.lisp.org/HyperSpec/Body/mac_defconstant.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>DEFCONSTANT</TT
+></A
+> does not check
+ this.</P
+><P
+ALIGN="justify"
+><A
+HREF="http://www.lisp.org/HyperSpec/Body/glo_c.html#constant_variable"
+TARGET="_top"
+>constant variable</A
+>s may not be bound dynamically or lexically.</P
+><DIV
+CLASS="formalpara"
+><P
+><A
+NAME="spe-var-p"
+></A
+><B
+>Function <A
+HREF="eval-comp.html#spe-var-p"
+><TT
+CLASS="function"
+>EXT:SPECIAL-VARIABLE-P</TT
+></A
+>. </B
+>You can use the function <TT
+CLASS="sexp"
+>(<A
+HREF="eval-comp.html#spe-var-p"
+><TT
+CLASS="function"
+>EXT:SPECIAL-VARIABLE-P</TT
+></A
+>
+  <TT
+CLASS="replaceable"
+><I
+>symbol</I
+></TT
+> <A
+HREF="http://www.lisp.org/HyperSpec/Body/sec_3-4-1.html"
+TARGET="_top"
+><TT
+CLASS="literal"
+>&#38;OPTIONAL</TT
+></A
+> <TT
+CLASS="replaceable"
+><I
+>env</I
+></TT
+>)</TT
+> to check whether the
+ symbol is a special variable.  <TT
+CLASS="replaceable"
+><I
+>env</I
+></TT
+> of <A
+HREF="http://www.lisp.org/HyperSpec/Body/convar_nil.html"
+TARGET="_top"
+><TT
+CLASS="constant"
+>NIL</TT
+></A
+> or omitted means use
+ the global environment, <A
+HREF="http://www.lisp.org/HyperSpec/Body/convar_t.html"
+TARGET="_top"
+><TT
+CLASS="constant"
+>T</TT
+></A
+> means use current lexical environment.
+ You can also obtain the current lexical environment using the macro
+ <A
+HREF="eval.html#the-env"
+><TT
+CLASS="function"
+>EXT:THE-ENVIRONMENT</TT
+></A
+> (interpreted code only).
+ This function will always return <A
+HREF="http://www.lisp.org/HyperSpec/Body/convar_t.html"
+TARGET="_top"
+><TT
+CLASS="constant"
+>T</TT
+></A
+> for global special
+ variables and constants.
+ Note that this function will not work in compiled code as you expect:
+ when called with <A
+HREF="http://www.lisp.org/HyperSpec/Body/convar_nil.html"
+TARGET="_top"
+><TT
+CLASS="constant"
+>NIL</TT
+></A
+> <TT
+CLASS="replaceable"
+><I
+>env</I
+></TT
+>, it will be called at <I
+CLASS="emphasis"
+>run
+  time</I
+> and check for globally special variables,
+ but when <TT
+CLASS="replaceable"
+><I
+>env</I
+></TT
+> is <A
+HREF="http://www.lisp.org/HyperSpec/Body/convar_t.html"
+TARGET="_top"
+><TT
+CLASS="constant"
+>T</TT
+></A
+>, it will be called at <I
+CLASS="emphasis"
+>compile
+  time</I
+> and the value will be used as a constant in the
+ code.</P
+></DIV
+></DIV
+><DIV
+CLASS="section"
+><H2
+CLASS="section"
+><A
+NAME="constantp"
+></A
+>3.5.2. Function <A
+HREF="http://www.lisp.org/HyperSpec/Body/fun_constantp.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>CONSTANTP</TT
+></A
+>.</H2
+><P
+ALIGN="justify"
+>Function <A
+HREF="http://www.lisp.org/HyperSpec/Body/fun_constantp.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>CONSTANTP</TT
+></A
+> fully complies with <A
+HREF="references.html#ansi-cl"
+>[<SPAN
+CLASS="citation"
+><A
+HREF="references.html#ansi-cl"
+>ANSI CL standard</A
+></SPAN
+>]</A
+>.
+Additionally, some non-trivial forms are identified as constants, e.g.,
+<TT
+CLASS="sexp"
+>(<A
+HREF="http://www.lisp.org/HyperSpec/Body/fun_constantp.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>CONSTANTP</TT
+></A
+> '(<A
+HREF="http://www.lisp.org/HyperSpec/Body/fun_pl.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>+</TT
+></A
+> 1 2 3))</TT
+> returns
+<A
+HREF="http://www.lisp.org/HyperSpec/Body/convar_t.html"
+TARGET="_top"
+><TT
+CLASS="constant"
+>T</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="section"
+><H2
+CLASS="section"
+><A
+NAME="eval-when"
+></A
+>3.5.3. Macro <A
+HREF="http://www.lisp.org/HyperSpec/Body/speope_eval-when.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>EVAL-WHEN</TT
+></A
+></H2
+><P
+ALIGN="justify"
+><A
+HREF="http://www.lisp.org/HyperSpec/Body/speope_eval-when.html"
+TARGET="_top"
+><TT
+CLASS="function"
+>EVAL-WHEN</TT
+></A
+> also accepts the situations <TT
+CLASS="sexp"
+>(NOT
+ EVAL)</TT
+> and <TT
+CLASS="sexp"
+>(NOT COMPILE)</TT
+>.</P
+><DIV
+CLASS="warning"
+><P
+></P
+><TABLE
+CLASS="warning"
+WIDTH="100%"
+BORDER="0"
+><TR
+><TD
+WIDTH="25"
+ALIGN="CENTER"
+VALIGN="TOP"
+><IMG
+SRC="/usr/share/sgml/docbook/dsssl-stylesheets/images/warning.gif"
+HSPACE="5"
+ALT="Warning"></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+ALIGN="justify"
+>Note that the situations <TT
+CLASS="constant"
+>EVAL</TT
+>,
+ <TT
+CLASS="constant"
+>LOAD</TT
+> and <TT
+CLASS="constant"
+>COMPILE</TT
+> are
+ deprecated by the spec, and they are <I
+CLASS="emphasis"
+>not</I
+> equivalent to the new
+ standard situations <TT
+CLASS="constant"
+>:EXECUTE</TT
+>,
+ <TT
+CLASS="constant"
+>:LOAD-TOPLEVEL</TT
+>
+ and <TT
+CLASS="constant"
+>:COMPILE-TOPLEVEL</TT
+> in that they ignore the
+ top-level versus non-top-level distinction.</P
+></TD
+></TR
+></TABLE
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="lalist.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="impnotes-top.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="types-classes.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Lambda Lists
+   <A
+HREF="http://www.lisp.org/HyperSpec/Body/sec_3-4.html"
+TARGET="_top"
+>[CLHS-3.4]</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eval.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Types and Classes
+   <A
+HREF="http://www.lisp.org/HyperSpec/Body/chap-4.html"
+TARGET="_top"
+>[CLHS-4]</A
+></TD
+></TR
+></TABLE
+></DIV
+><div
+class="custom-footer"
+><hr
+width="100%"><table
+width="100%"
+><tr
+><td
+align="left"
+><a
+href="http://clisp.cons.org"
+><img
+src="clisp.png"
+width="48"
+height="48"
+alt="[CLISP home]"></a
+></td
+><td
+align="center"
+><a
+href="http://www.gnu.org"
+><img
+src="http://www.gnu.org/graphics/gnubanner.jpg"
+width="468"
+height="60"
+alt="[Come and see what GNU creates for YOU]"></a
+></td
+><td
+align="right"
+><a
+href="http://sourceforge.net"
+><img
+src="http://sourceforge.net/sflogo.php?group_id=1355&amp;type=2"
+width="125"
+height="37"
+alt="[SourceForge]"></a
+></td
+></tr
+></table
+></div
+></BODY
+></HTML
+>