75 lines
3.9 KiB
HTML
75 lines
3.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE>26.3.1. Order of Execution</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" Order of Execution">
|
|
<meta name="keywords" value="clm">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<b>Common Lisp the Language, 2nd Edition</b>
|
|
<BR> <HR><A NAME=tex2html4558 HREF="node240.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html4556 HREF="node238.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html4550 HREF="node238.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html4560 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html4561 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html4559 HREF="node240.html"> Kinds of Loop </A>
|
|
<B>Up:</B> <A NAME=tex2html4557 HREF="node238.html"> Parsing Loop Clauses</A>
|
|
<B> Previous:</B> <A NAME=tex2html4551 HREF="node238.html"> Parsing Loop Clauses</A>
|
|
<HR> <P>
|
|
<H2><A NAME=SECTION003031000000000000000>26.3.1. Order of Execution</A></H2>
|
|
<P>
|
|
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
|
|
With the exceptions listed below, clauses are executed in the loop body
|
|
in the order in which they appear in the source. Execution is repeated
|
|
until a clause
|
|
terminates the loop or until a Common Lisp <tt>return</tt>,
|
|
<tt>go</tt>, or <tt>throw</tt> form is encountered. The following actions are
|
|
exceptions to the linear order of execution:
|
|
<P>
|
|
<UL> <LI>
|
|
All variables are initialized first, regardless of where the establishing
|
|
clauses appear in the source. The order of initialization follows the
|
|
order of these clauses.
|
|
<P>
|
|
<LI>
|
|
The code for any <tt>initially</tt> clauses is collected
|
|
into one <tt>progn</tt> in the order in which the clauses appear in
|
|
the source. The collected code is executed once in the loop prologue
|
|
after any implicit variable initializations.
|
|
<P>
|
|
<LI>
|
|
The code for any <tt>finally</tt> clauses is collected
|
|
into one <tt>progn</tt> in the order in which the clauses appear in
|
|
the source. The collected code is executed once in the loop epilogue
|
|
before any implicit values from the accumulation clauses are returned.
|
|
Explicit returns anywhere in the source, however, will exit the loop
|
|
without executing the epilogue code.
|
|
<P>
|
|
<LI>
|
|
A <tt>with</tt> clause introduces a variable binding and an optional
|
|
initial value. The initial values are calculated in the order in
|
|
which the <tt>with</tt> clauses occur.
|
|
<P>
|
|
<LI>
|
|
Iteration control clauses implicitly perform the following actions:<p>
|
|
<UL>
|
|
<LI> initializing variables <P>
|
|
<LI>
|
|
stepping variables, generally between each execution of the loop body
|
|
<P>
|
|
<LI>
|
|
performing termination tests, generally just before the execution of the
|
|
loop body
|
|
</UL>
|
|
</UL>
|
|
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html4558 HREF="node240.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html4556 HREF="node238.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html4550 HREF="node238.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html4560 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html4561 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html4559 HREF="node240.html"> Kinds of Loop </A>
|
|
<B>Up:</B> <A NAME=tex2html4557 HREF="node238.html"> Parsing Loop Clauses</A>
|
|
<B> Previous:</B> <A NAME=tex2html4551 HREF="node238.html"> Parsing Loop Clauses</A>
|
|
<HR> <P>
|
|
<HR>
|
|
<P><ADDRESS>
|
|
AI.Repository@cs.cmu.edu
|
|
</ADDRESS>
|
|
</BODY>
|