| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>The for-as-in-list subclause (ANSI and GNU Common Lisp Document)</title> |
| 7 |
|
| 8 |
<meta name="description" content="The for-as-in-list subclause (ANSI and GNU Common Lisp Document)"> |
| 9 |
<meta name="keywords" content="The for-as-in-list subclause (ANSI and GNU Common Lisp Document)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="Variable-Initialization-and-Stepping-Clauses.html" rel="up" title="Variable Initialization and Stepping Clauses"> |
| 15 |
<link href="Examples-of-for_002das_002din_002dlist-subclause.html" rel="next" title="Examples of for-as-in-list subclause"> |
| 16 |
<link href="Examples-of-for_002das_002darithmetic-subclause.html" rel="prev" title="Examples of for-as-arithmetic subclause"> |
| 17 |
<style type="text/css"> |
| 18 |
<!-- |
| 19 |
a.summary-letter {text-decoration: none} |
| 20 |
blockquote.indentedblock {margin-right: 0em} |
| 21 |
div.display {margin-left: 3.2em} |
| 22 |
div.example {margin-left: 3.2em} |
| 23 |
div.lisp {margin-left: 3.2em} |
| 24 |
kbd {font-style: oblique} |
| 25 |
pre.display {font-family: inherit} |
| 26 |
pre.format {font-family: inherit} |
| 27 |
pre.menu-comment {font-family: serif} |
| 28 |
pre.menu-preformatted {font-family: serif} |
| 29 |
span.nolinebreak {white-space: nowrap} |
| 30 |
span.roman {font-family: initial; font-weight: normal} |
| 31 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 32 |
ul.no-bullet {list-style: none} |
| 33 |
--> |
| 34 |
</style> |
| 35 |
|
| 36 |
|
| 37 |
</head> |
| 38 |
|
| 39 |
<body lang="en"> |
| 40 |
<span id="The-for_002das_002din_002dlist-subclause"></span><div class="header"> |
| 41 |
<p> |
| 42 |
Next: <a href="Examples-of-for_002das_002din_002dlist-subclause.html" accesskey="n" rel="next">Examples of for-as-in-list subclause</a>, Previous: <a href="Examples-of-for_002das_002darithmetic-subclause.html" accesskey="p" rel="prev">Examples of for-as-arithmetic subclause</a>, Up: <a href="Variable-Initialization-and-Stepping-Clauses.html" accesskey="u" rel="up">Variable Initialization and Stepping Clauses</a> </p> |
| 43 |
</div> |
| 44 |
<hr> |
| 45 |
<span id="The-for_002das_002din_002dlist-subclause-1"></span><h4 class="subsubsection">6.1.2.4 The for-as-in-list subclause</h4> |
| 46 |
|
| 47 |
<p>In the <i>for-as-in-list</i> subclause, |
| 48 |
the <tt>for</tt> |
| 49 |
or <tt>as</tt> construct iterates over the contents of a |
| 50 |
<i>list</i>. It checks for |
| 51 |
the end of the <i>list</i> as if by using <b>endp</b>. |
| 52 |
The variable <i>var</i> is bound to the successive elements of |
| 53 |
the <i>list</i> in <i>form1</i> before each |
| 54 |
iteration. At the end of each iteration, the function <i>step-fun</i> |
| 55 |
is applied to the <i>list</i>; the default value for <i>step-fun</i> is |
| 56 |
<b>cdr</b>. |
| 57 |
The <i>loop keywords</i> <tt>in</tt> and <tt>by</tt> serve as valid prepositions in |
| 58 |
this syntax. |
| 59 |
The <tt>for</tt> or <tt>as</tt> construct causes termination when the |
| 60 |
end of the <i>list</i> is reached. |
| 61 |
</p> |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
</body> |
| 66 |
</html> |