| 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>Iteration and Tests (GCL SI Manual)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Iteration and Tests (GCL SI Manual)"> |
| 9 |
<meta name="keywords" content="Iteration and Tests (GCL SI Manual)"> |
| 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="Function-and-Variable-Index.html" rel="index" title="Function and Variable Index"> |
| 15 |
<link href="Function-and-Variable-Index.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| 16 |
<link href="index.html" rel="up" title="Top"> |
| 17 |
<link href="User-Interface.html" rel="next" title="User Interface"> |
| 18 |
<link href="Structures.html" rel="prev" title="Structures"> |
| 19 |
<style type="text/css"> |
| 20 |
<!-- |
| 21 |
a.summary-letter {text-decoration: none} |
| 22 |
blockquote.indentedblock {margin-right: 0em} |
| 23 |
div.display {margin-left: 3.2em} |
| 24 |
div.example {margin-left: 3.2em} |
| 25 |
div.lisp {margin-left: 3.2em} |
| 26 |
kbd {font-style: oblique} |
| 27 |
pre.display {font-family: inherit} |
| 28 |
pre.format {font-family: inherit} |
| 29 |
pre.menu-comment {font-family: serif} |
| 30 |
pre.menu-preformatted {font-family: serif} |
| 31 |
span.nolinebreak {white-space: nowrap} |
| 32 |
span.roman {font-family: initial; font-weight: normal} |
| 33 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 34 |
ul.no-bullet {list-style: none} |
| 35 |
--> |
| 36 |
</style> |
| 37 |
|
| 38 |
|
| 39 |
</head> |
| 40 |
|
| 41 |
<body lang="en"> |
| 42 |
<span id="Iteration-and-Tests"></span><div class="header"> |
| 43 |
<p> |
| 44 |
Next: <a href="User-Interface.html" accesskey="n" rel="next">User Interface</a>, Previous: <a href="Structures.html" accesskey="p" rel="prev">Structures</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 45 |
</div> |
| 46 |
<hr> |
| 47 |
<span id="Iteration-and-Tests-1"></span><h2 class="chapter">11 Iteration and Tests</h2> |
| 48 |
|
| 49 |
<dl> |
| 50 |
<dt id="index-DO_002dEXTERNAL_002dSYMBOLS">Macro: <strong>DO-EXTERNAL-SYMBOLS</strong></dt> |
| 51 |
<dd><p>Package:LISP |
| 52 |
</p> |
| 53 |
<p>Syntax: |
| 54 |
</p><div class="example"> |
| 55 |
<pre class="example">(do-external-symbols (var [package [result-form]]) |
| 56 |
{decl}* {tag | statement}*) |
| 57 |
</pre></div> |
| 58 |
|
| 59 |
<p>Executes STATEMENTs once for each external symbol in the PACKAGE (which |
| 60 |
defaults to the current package), with VAR bound to the current symbol. |
| 61 |
Then evaluates RESULT-FORM (which defaults to NIL) and returns the value(s). |
| 62 |
</p> |
| 63 |
|
| 64 |
</dd></dl> |
| 65 |
|
| 66 |
<dl> |
| 67 |
<dt id="index-DO_002a">Special Form: <strong>DO*</strong></dt> |
| 68 |
<dd><p>Package:LISP |
| 69 |
</p> |
| 70 |
<p>Syntax: |
| 71 |
</p><div class="example"> |
| 72 |
<pre class="example">(do* ({(var [init [step]])}*) (endtest {result}*) |
| 73 |
{decl}* {tag | statement}*) |
| 74 |
</pre></div> |
| 75 |
|
| 76 |
<p>Just like DO, but performs variable bindings and assignments in serial, just |
| 77 |
like LET* and SETQ do. |
| 78 |
</p> |
| 79 |
|
| 80 |
</dd></dl> |
| 81 |
|
| 82 |
<dl> |
| 83 |
<dt id="index-DO_002dALL_002dSYMBOLS">Macro: <strong>DO-ALL-SYMBOLS</strong></dt> |
| 84 |
<dd><p>Package:LISP |
| 85 |
</p> |
| 86 |
<p>Syntax: |
| 87 |
</p><div class="example"> |
| 88 |
<pre class="example">(do-all-symbols (var [result-form]) {decl}* {tag | statement}*) |
| 89 |
</pre></div> |
| 90 |
|
| 91 |
<p>Executes STATEMENTs once for each symbol in each package, with VAR bound to |
| 92 |
the current symbol. Then evaluates RESULT-FORM (which defaults to NIL) and |
| 93 |
returns the value(s). |
| 94 |
</p> |
| 95 |
|
| 96 |
</dd></dl> |
| 97 |
|
| 98 |
<dl> |
| 99 |
<dt id="index-YES_002dOR_002dNO_002dP">Function: <strong>YES-OR-NO-P</strong> <em>(&optional (format-string nil) &rest args)</em></dt> |
| 100 |
<dd><p>Package:LISP |
| 101 |
</p> |
| 102 |
<p>Asks the user a question whose answer is either ’YES’ or ’NO’. If FORMAT- |
| 103 |
STRING is non-NIL, then FRESH-LINE operation is performed, a message is |
| 104 |
printed as if FORMAT-STRING and ARGs were given to FORMAT, and then a prompt |
| 105 |
"(Yes or No)" is printed. Otherwise, no prompt will appear. |
| 106 |
</p> |
| 107 |
|
| 108 |
</dd></dl> |
| 109 |
|
| 110 |
<dl> |
| 111 |
<dt id="index-MAPHASH">Function: <strong>MAPHASH</strong> <em>#'hash-table</em></dt> |
| 112 |
<dd><p>Package:LISP |
| 113 |
</p> |
| 114 |
<p>For each entry in HASH-TABLE, calls FUNCTION on the key and value of the |
| 115 |
entry; returns NIL. |
| 116 |
</p> |
| 117 |
|
| 118 |
</dd></dl> |
| 119 |
|
| 120 |
<dl> |
| 121 |
<dt id="index-MAPCAR">Function: <strong>MAPCAR</strong> <em>(fun list &rest more-lists)</em></dt> |
| 122 |
<dd><p>Package:LISP |
| 123 |
</p> |
| 124 |
<p>Applies FUN to successive cars of LISTs and returns the results as a list. |
| 125 |
</p> |
| 126 |
|
| 127 |
</dd></dl> |
| 128 |
|
| 129 |
<dl> |
| 130 |
<dt id="index-DOLIST">Special Form: <strong>DOLIST</strong></dt> |
| 131 |
<dd><p>Package:LISP |
| 132 |
</p> |
| 133 |
<p>Syntax: |
| 134 |
</p><div class="example"> |
| 135 |
<pre class="example">(dolist (var listform [result]) {decl}* {tag | statement}*) |
| 136 |
</pre></div> |
| 137 |
|
| 138 |
<p>Executes STATEMENTs, with VAR bound to each member of the list value of |
| 139 |
LISTFORM. Then returns the value(s) of RESULT (which defaults to NIL). |
| 140 |
</p> |
| 141 |
|
| 142 |
</dd></dl> |
| 143 |
|
| 144 |
<dl> |
| 145 |
<dt id="index-EQ">Function: <strong>EQ</strong> <em>(x y)</em></dt> |
| 146 |
<dd><p>Package:LISP |
| 147 |
</p> |
| 148 |
<p>Returns T if X and Y are the same identical object; NIL otherwise. |
| 149 |
</p> |
| 150 |
|
| 151 |
</dd></dl> |
| 152 |
|
| 153 |
<dl> |
| 154 |
<dt id="index-EQUALP">Function: <strong>EQUALP</strong> <em>(x y)</em></dt> |
| 155 |
<dd><p>Package:LISP |
| 156 |
</p> |
| 157 |
<p>Returns T if X and Y are EQUAL, if they are characters and satisfy CHAR-EQUAL, |
| 158 |
if they are numbers and have the same numerical value, or if they have |
| 159 |
components that are all EQUALP. Returns NIL otherwise. |
| 160 |
</p> |
| 161 |
|
| 162 |
</dd></dl> |
| 163 |
|
| 164 |
<dl> |
| 165 |
<dt id="index-EQUAL">Function: <strong>EQUAL</strong> <em>(x y)</em></dt> |
| 166 |
<dd><p>Package:LISP |
| 167 |
</p> |
| 168 |
<p>Returns T if X and Y are EQL or if they are of the same type and corresponding |
| 169 |
components are EQUAL. Returns NIL otherwise. Strings and bit-vectors are |
| 170 |
EQUAL if they are the same length and have identical components. Other |
| 171 |
arrays must be EQ to be EQUAL. |
| 172 |
</p> |
| 173 |
|
| 174 |
</dd></dl> |
| 175 |
|
| 176 |
<dl> |
| 177 |
<dt id="index-DO_002dSYMBOLS">Macro: <strong>DO-SYMBOLS</strong></dt> |
| 178 |
<dd><p>Package:LISP |
| 179 |
</p> |
| 180 |
<p>Syntax: |
| 181 |
</p><div class="example"> |
| 182 |
<pre class="example">(do-symbols (var [package [result-form]]) {decl}* {tag | |
| 183 |
statement}*) |
| 184 |
</pre></div> |
| 185 |
|
| 186 |
<p>Executes STATEMENTs once for each symbol in the PACKAGE (which defaults to |
| 187 |
the current package), with VAR bound to the current symbol. Then evaluates |
| 188 |
RESULT-FORM (which defaults to NIL) and returns the value(s). |
| 189 |
</p> |
| 190 |
|
| 191 |
</dd></dl> |
| 192 |
|
| 193 |
<dl> |
| 194 |
<dt id="index-LOOP">Special Form: <strong>LOOP</strong></dt> |
| 195 |
<dd><p>Package:LISP |
| 196 |
</p> |
| 197 |
<p>Syntax: |
| 198 |
</p><div class="example"> |
| 199 |
<pre class="example">(loop {form}*) |
| 200 |
</pre></div> |
| 201 |
|
| 202 |
<p>Executes FORMs repeatedly until exited by a THROW or RETURN. The FORMs are |
| 203 |
surrounded by an implicit NIL block. |
| 204 |
</p> |
| 205 |
|
| 206 |
</dd></dl> |
| 207 |
|
| 208 |
<hr> |
| 209 |
<div class="header"> |
| 210 |
<p> |
| 211 |
Next: <a href="User-Interface.html" accesskey="n" rel="next">User Interface</a>, Previous: <a href="Structures.html" accesskey="p" rel="prev">Structures</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 212 |
</div> |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
</body> |
| 217 |
</html> |