cosmetic surgery on loop figure; a few minor changes elsewhere
[clqr.git] / clqr-control-structure.tex
blob287910f23ff4c240cef94c28966ad66a6662f039
1 % Copyright (C) 2008 Bert Burgemeister
3 % Permission is granted to copy, distribute and/or modify this
4 % document under the terms of the GNU Free Documentation License,
5 % Version 1.2 or any later version published by the Free Software
6 % Foundation; with no Invariant Sections, no Front-Cover Texts and
7 % no Back-Cover Texts. For details see file COPYING.
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{Control Structure}
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 \subsection{Predicates}
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17 \begin{LIST}{1cm}
19 \IT{(\FU*{EQ} \VAR{foo bar})}
21 \retval{\T} if \VAR{foo} and \VAR{bar} are identical.
24 \IT{(\FU*{EQL} \VAR{foo bar})}
26 \retval{\T} if \VAR{foo} and \VAR{bar}
27 are identical, or the same \kwd{character}, or \kwd{number}s of the
28 same type and value.
31 \IT{(\FU*{EQUAL} \VAR{foo bar})}
33 \retval{\T} if \VAR{foo} and \VAR{bar}
34 are \FU{EQL}, or are equivalent \kwd{pathname}s, or are \kwd{cons}es with
35 \FU{equal} cars and cdrs, or are \kwd{string}s or \kwd{bit-vector}s with
36 \FU{eql} elements below their fill pointers.
39 \IT{(\FU*{EQUALP} \VAR{foo bar})}
41 \retval{\T} if \VAR{foo} and \VAR{bar} are identical; or are the
42 same \kwd{character} ignoring case; or are \kwd{number}s of the same
43 value ignoring type; or are equivalant \kwd{pathname}s; or are
44 \kwd{cons}es or \kwd{array}s of the same shape with \FU{equalp}
45 elements; or are structures of the same \kwd{class} with
46 \kwd{equalp} elements; or are \kwd{hash-table}s of the same size
47 with the same \kwd{:test} function, the same keys in terms of
48 \kwd{:test} function, and \kwd{equalp} elements.
51 \IT{(\FU*{NOT} \VAR{bool})}
53 \retval{\NIL} if \VAR{bool} is \T; \retval{\T} if \VAR{bool} is \NIL.
56 \IT{(\FU*{BOUNDP} \VAR{symbol})}
58 \retval{\T} if \VAR{symbol} is a special variable.
61 \IT{(\FU*{CONSTANTP} \VAR{foo} \Op{\VAR{environment}\DF{\NIL}})}
63 \retval{\T} if \VAR{foo} is a constant form.
66 \IT{(\FU*{FUNCTIONP} \VAR{foo})}
68 \retval{\T} if \VAR{foo} is of type \kwd{function}.
71 \IT{(\FU*{FBOUNDP} \VAR{foo})}
73 \retval{\T} if \VAR{foo} is a global function or macro.
77 \end{LIST}
80 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 \subsection{Variables}
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 \begin{LIST}{1cm}
86 \IT{(\xorGOO{%
87 \MC*{DEFCONSTANT}\\
88 \MC*{DEFPARAMETER}}{\}} \NEV{\VAR{foo}} \VAR{form}
89 \Op{\NEV{\VAR{doc}}})}
91 Assign value of \VAR{form} to global constant/dynamic variable \retval{\VAR{foo}}.
94 \IT{(\MC*{DEFVAR} \NEV{\VAR{foo}} \OP{\VAR{form}
95 \Op{\NEV{\VAR{doc}}}})}
97 Unless bound already, assign value of \VAR{form} to dynamic variable
98 \retval{\VAR{foo}}.
101 \IT{(\xorGOO{\MC*{SETF}\\
102 \MC*{PSETF}}{\}} \Goos{\VAR{place}
103 \VAR{form}})}
105 Set \VAR{place}s to values of \VAR{form}s. Return \retval{value
106 of last \VAR{form}}. Work sequentially/in parallel, respectively.
109 \IT{(\xorGOO{\SO*{SETQ}\\
110 \MC*{PSETQ}}{\}} \Goos{\VAR{symbol}
111 \VAR{form}})}
113 Set \VAR{symbol}s to values of \VAR{form}s. Return \retval{value
114 of last \VAR{form}}. Work sequentially/in parallel, respectively.
117 \IT{(\FU*{SET} \DES{\VAR{symbol}} \VAR{foo})}
119 Set \VAR{symbol}'s value cell to \retval{\VAR{foo}}. Deprecated.
122 \IT{(\MC*{MULTIPLE-VALUE-SETQ} \VAR{vars} \VAR{form})}
124 Set elements of \VAR{vars} to the values of
125 \VAR{form}. Return \retval{\VAR{form}'s primary value}.
128 \IT{(\MC*{SHIFTF} \RP{\DES{\VAR{place}}} \VAR{foo})}
130 Store value of \VAR{foo} in rightmost \VAR{place} shifting values of
131 \VAR{place}s left, returning \retval{first \VAR{place}}.
134 \IT{(\MC*{ROTATEF} \OPn{\DES{\VAR{place}}})}
136 Rotate values of \VAR{place}s left, old first becoming new last
137 \VAR{place}'s value. Return \retval{\NIL}.
140 \IT{(\FU*{MAKUNBOUND} \DES{\VAR{foo}})}
142 Delete special variable \retval{\VAR{foo}} if any.
145 \label{:property_lists}
146 \IT{\arrGOO{(\FU*{GET} \VAR{ symbol} \VAR{ key }
147 \OP{\VAR{default}\DF{\NIL}})\\
148 (\FU*{GETF} \VAR{ place} \VAR{ key }
149 \OP{\VAR{default}\DF{\NIL}})}{.}}
151 \retval{First entry \VAR{key}} from property list stored in
152 \VAR{symbol}/in \VAR{place}, respectively, or \retval{\VAR{default}} if
153 there was no \VAR{key}. \kwd{setf}able.
156 \IT{(\FU*{GET-PROPERTIES} \VAR{property-list} \VAR{keys})}
158 Return \retval{key} and \retvalii{value} of first entry from \VAR{property-list}
159 matching a key from \VAR{keys}, and \retvaliii{tail of
160 \VAR{property-list}} starting with that key. Return \retval{\NIL},
161 \retvalii{\NIL}, and \retvaliii{\NIL} if there was no matching key
162 in \VAR{property-list}.
165 \IT{\arrGOO{(\FU*{REMPROP } \DES{\VAR{symbol}} \VAR{ key})\\
166 (\MC*{REMF } \DES{\VAR{place}} \VAR{ key})}{.}}
168 Remove first entry \VAR{key} from property list stored in
169 \VAR{symbol}/in \VAR{place}, respectively. Return \retval{\T} if \VAR{key}
170 was there, or \retval{\NIL} otherwise.
173 \end{LIST}
176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
177 \subsection{Functions}
178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 \label{section:Functions}
181 \begin{flushleft}
182 Below, ordinary lambda list (\OPn{\VAR{ord-$\lambda$}}) has the form\\
183 % \VAR{var} referenced from DEFSTRUCT
184 (\OPn{\VAR{var}}
185 \OP{\kwd*{\&optional} \xorGOO{%
186 \VAR{var}\\
187 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}}}
188 \penalty-5
189 \Op{\kwd*{\&rest} \VAR{var}}
190 \penalty-5
191 \OP{\kwd*{\&key} \xorGOO{%
192 \VAR{var}\\
193 (\xorGOO{%
194 \VAR{var}\\
195 (\kwd{:}\VAR{key } \VAR{var})}{\}}
196 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ }\Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
197 \penalty-5
198 \Op{\kwd*{\&allow-other-keys}}}
199 \penalty-5
200 \OP{\kwd*{\&aux} \xorGOO{%
201 \VAR{var}\\
202 (\VAR{var } \Op{\VAR{init}\DF{\NIL}})}{\}}}).\\
203 \VAR{supplied-p} is \T\ if there is a corresponding
204 argument. \VAR{init} forms can refer to any \VAR{init} and
205 \VAR{supplied-p} to their left.
206 \end{flushleft}
208 \begin{LIST}{1cm}
210 \IT{(\xorGOO{\MC*{DEFUN }\xorGOO{\VAR{foo}\\
211 (\kwd{setf} \VAR{ foo})}{.}\\
212 \MC*{LAMBDA}}{\}}
213 (\VAR{\OPn{ord-$\lambda$}}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
214 \Op{\NEV{\VAR{doc}}}
215 \PROGN{\VAR{form}})}
217 Define a function named \retval{\VAR{foo}} or \retval{(\kwd{setf}
218 \VAR{foo})}, or an anonymous \retval{function}, respectively, which applies
219 \VAR{form}s to \VAR{ord-$\lambda$}s. For \MC{defun}, \VAR{form}s are
220 enclosed in an implicit \SO{block} \VAR{foo}.
223 \IT{(\xorGOO{\SO*{FLET}\\
224 \SO*{LABELS}}{\}}
225 (\OPn{(\VAR{foo}
226 (\OPn{\VAR{ord-$\lambda$}})
227 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{local-decl}}})}
228 \Op{\NEV{\VAR{doc}}}
229 \PROGN{\VAR{local-form}})}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
230 \PROGN{\VAR{form}})}
232 Evaluate \VAR{form}s with
233 locally defined functions \VAR{foo}. Each \VAR{foo} is also the name
234 of an implicit \SO{block} around its corresponding
235 \OPn{\VAR{local-form}}. Only for \SO{LABELS}, functions \VAR{foo} are visible inside \VAR{local-forms}. Return
236 \retval{values of \VAR{form}s}.
239 \IT{(\SO*{FUNCTION} \xorGOO{%
240 \VAR{foo}\\
241 (\MC{lambda } \OPn{\VAR{form}})}{\}})}
243 Return lexically innermost \retval{function} named \VAR{foo} or a
244 lexical closure of the \retval{\MC{lambda} expression}.
247 \IT{(\FU*{APPLY} \VAR{function} \RP{\VAR{arg}})}
249 Return \retval{values of \VAR{function}} called on
250 \VAR{arg}s. Last \VAR{arg} must be a list. \kwd{setf}able if
251 \VAR{function} is one of \FU{aref}, \FU{bit}, and \FU{sbit}.
254 \IT{(\FU*{FUNCALL} \VAR{function} \OPn{arg})}
256 Return \retval{values of \VAR{function}} called with \VAR{arg}s.
259 \IT{(\SO*{MULTIPLE-VALUE-CALL} \VAR{foo} \OPn{\VAR{form}})}
260 {Call function
261 \VAR{foo} with all the values of each \VAR{form} as its arguments. Return
262 \retval{values returned by \VAR{foo}}.
265 \IT{(\FU*{VALUES-LIST} \VAR{list})}
267 Return \retval{elements of \VAR{list}}.
270 \IT{(\FU*{VALUES} \OPn{\VAR{foo}})}
272 Return as multiple values the \retval{primary values} of the
273 \VAR{foo}s. \kwd{setf}able.
276 \IT{(\FU*{MULTIPLE-VALUE-LIST} \VAR{form})}
278 Return in a \retval{list} values of \VAR{form}.
281 \IT{(\FU*{NTH-VALUE} \VAR{n} \VAR{form})}
283 Zero-indexed \retval{\VAR{n}th return value} of \VAR{form}.
286 \IT{(\FU*{COMPLEMENT} \VAR{function})}
288 Return \retval{new function} with same arguments and same side effects
289 as \VAR{function}, but with complementary truth value.
292 \IT{(\FU*{CONSTANTLY} \VAR{foo})}
294 Return \retval{function} of any number of arguments returning \VAR{foo}.
297 \IT{(\FU*{IDENTITY} \VAR{foo})}
299 Return \retval{\VAR{foo}}.
302 \IT{(\FU*{FUNCTION-LAMBDA-EXPRESSION} \VAR{function})}
304 If available, return \retval{lambda expression} of \VAR{function},
305 \retvalii{\NIL} if \VAR{function} was defined in an environment
306 without bindings, and \retvaliii{name} of \VAR{function}.
309 \IT{(\FU*{FDEFINITION} \VAR{foo})}
311 \retval{Definition} of global function \VAR{foo}. \kwd{setf}able.
314 \IT{(\FU*{FMAKUNBOUND} \VAR{foo})}
316 Remove global function or macro definition \retval{\VAR{foo}}.
319 \IT{\arrGOO{\CNS*{CALL-ARGUMENTS-LIMIT}\\
320 \CNS*{LAMBDA-PARAMETERS-LIMIT}}{.}}
322 Upper bound of the number of function arguments or lambda list
323 parameters, respectively; $\geq50$.
326 \IT{\CNS*{MULTIPLE-VALUES-LIMIT}}
328 Upper bound of the number of values a function can return; $\geq20$.
331 \end{LIST}
334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
335 \subsection{Macros}
336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
337 \label{section:Macros}
339 \begin{flushleft}
340 Below, macro lambda list (\OPn{\VAR{macro-$\lambda$}}) has the form of
341 either
342 \penalty-5
343 (\Op{\kwd*{\&whole} \VAR{var}}
344 \penalty-5
345 \Op{\VAR{E}}
346 \penalty-5
347 \xorGOO{%
348 \VAR{var}\\
349 (\OPn{\VAR{macro-$\lambda$}})}{\}^{\!\!*}}
350 \penalty-5
351 \Op{\VAR{E}}
352 \penalty-5
353 \Op{\kwd*{\&optional}
354 \xorGOO{%
355 \VAR{var}\\
356 (\xorGOO{%
357 \VAR{var}\\
358 (\OPn{\VAR{macro-$\lambda$}})}{\}}\text{ }
359 \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}}
360 \penalty-5
361 \Op{\VAR{E}}
362 \penalty-5
363 \Op{%
364 \xorGOO{%
365 \kwd*{\&rest}\\
366 \kwd*{\&body}}{\}}
367 \xorGOO{%
368 \VAR{var}\\
369 (\OPn{\VAR{macro-$\lambda$}})}{\}}}
370 \penalty-5
371 \Op{\VAR{E}}
372 \penalty-5
373 \OP{\kwd*{\&key}
374 \xorGOO{%
375 \VAR{var}\\
376 (\xorGOO{%
377 \VAR{var}\\
378 (\kwd{:}\VAR{key } \xorGOO{%
379 \VAR{var}\\
380 (\OPn{\VAR{macro-$\lambda$}})}{\}})}{\}}
381 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
382 \Op{\VAR{E}}
383 \Op{\kwd*{\&allow-other-keys}}}
384 \penalty-5
385 \Op{\kwd*{\&aux}
386 \xorGOO{%
387 \VAR{var}\\
388 (\VAR{var } \Op{\VAR{init}\DF{\NIL}})}{\}^{\!\!*}}}
389 \penalty-5
390 \Op{\VAR{E}})
393 \penalty-5
394 (\Op{\kwd*{\&whole}
395 \VAR{var}}
396 \penalty-5
397 \Op{\VAR{E}}
398 \penalty-5
399 \xorGOO{%
400 \VAR{var}\\
401 (\OPn{\VAR{macro-$\lambda$}})}{\}^{\!\!*}}
402 \penalty-5
403 \Op{\VAR{E}}
404 \penalty-5
405 \Op{\kwd*{\&optional}
406 \xorGOO{%
407 \VAR{var}\\
408 (\xorGOO{%
409 \VAR{var}\\
410 (\OPn{\VAR{macro-$\lambda$}})}{\}}\text{ }
411 \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}}
412 \penalty-5
413 \Op{\VAR{E}}
414 \kwd{.}
415 \VAR{var}).
416 \penalty-5
417 One toplevel \Op{\VAR{E}} may be replaced by \kwd*{\&environment}
418 \VAR{var}. \VAR{supplied-p} is \T\ if there is a corresponding
419 argument.
420 \end{flushleft}
422 \begin{LIST}{1cm}
424 \IT{(\xorGOO{\MC*{DEFMACRO}\\
425 \FU*{DEFINE-COMPILER-MACRO}}{\}}
426 \VAR{foo} (\OPn{\VAR{macro-$\lambda$}})
427 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
428 \PROGN{\VAR{form}})}
430 Define macro \retval{\VAR{foo}} which on evaluation as (\VAR{foo}
431 \VAR{tree}) applies expanded \VAR{form}s to arguments from
432 \VAR{tree} which corresponds to \VAR{tree}-shaped
433 \VAR{macro-$\lambda$}s. \VAR{form}s are enclosed in an implicit
434 \SO{block} \VAR{foo}.
437 \IT{(\MC*{DEFINE-SYMBOL-MACRO} \VAR{foo} \VAR{form})}
439 Define symbol macro \retval{\VAR{foo}} which on evaluation evaluates
440 expanded \VAR{form}.
443 \IT{(\SO*{MACROLET} (\OPn{(\VAR{foo} (\OPn{\VAR{macro-$\lambda$}})
444 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{local-decl}}})}
445 \Op{\NEV{\VAR{doc}}} \PROGN{\VAR{macro-form}})}) \OPn{(\kwd{declare}
446 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
448 Evaluate \retval{\VAR{form}s} with locally defined mutually
449 invisible macros \VAR{foo} which are enclosed in implicit \SO{block}s
450 of the same name.
453 \IT{(\SO*{SYMBOL-MACROLET} (\OPn{(\VAR{foo}
454 \VAR{expansion-form})}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
455 \PROGN{\VAR{form}})}
457 Evaluate \retval{\VAR{form}s} with locally defined symbol macros
458 \VAR{foo}.
461 \IT{(\MC*{DEFSETF} \NEV{\VAR{function}} \xorGOO{%
462 \NEV{\VAR{updater}} \text{ } \Op{\NEV{\VAR{doc}}}\\
463 (\OPn{\VAR{setf-$\lambda$}}) \text{ } (\OPn{\VAR{s-var}}) \text{ }
464 \OPn{(\kwd{declare } \OPn{\NEV{\VAR{decl}}})}\text{ }
465 \Op{\NEV{\VAR{doc}}} \text{ } \PROGN{\VAR{form}}}{\}})
466 \penalty-5
467 where defsetf lambda list (\OPn{\VAR{setf-$\lambda$}}) has the form
468 \penalty-5
469 (\OPn{\VAR{var}}
470 \OP{\kwd*{\&optional} \xorGOO{%
471 \VAR{var}\\
472 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}}}
473 \penalty-5
474 \Op{\kwd*{\&rest} \VAR{var}}
475 \penalty-5
476 \OP{\kwd*{\&key} \xorGOO{%
477 \VAR{var}\\
478 (\xorGOO{%
479 \VAR{var}\\
480 (\kwd{:}\VAR{key } \VAR{var})}{\}}
481 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ }\Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
482 \penalty-5
483 \Op{\kwd*{\&allow-other-keys}}}
484 \penalty-5
485 \OP{\kwd*{\&environment} \VAR{var}}%
489 Specify how to \kwd{setf} a place accessed by
490 \retval{\VAR{function}}.
491 Short form: (\kwd{setf} (\VAR{function} \OPn{\VAR{arg}}) \VAR{value-form}) is
492 replaced by (\VAR{updater} \OPn{\VAR{arg}} \VAR{value-form}).
493 Long form: on invocation of (\kwd{setf} (\VAR{function}
494 \OPn{\VAR{arg}}) \VAR{value-form}), \VAR{form}s must expand
495 into code that sets the place accessed where \VAR{setf-$\lambda$}
496 and \OPn{\VAR{s-var}} describe the arguments of \VAR{function} and
497 the value(s) to be stored, respectively; and that returns
498 the value(s) of \OPn{\VAR{s-var}}. \VAR{form}s are enclosed in an
499 implicit \SO{block} \VAR{foo}.
502 \IT{(\MC*{DEFINE-SETF-EXPANDER} \VAR{function}
503 (\OPn{\VAR{macro-$\lambda$}})
504 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
505 \PROGN{\VAR{form}})}
507 Specify how to \kwd{setf} a place accessed by
508 \retval{\VAR{function}}. On invocation of (\kwd{setf} (\VAR{function}
509 \OPn{\VAR{arg}}) \VAR{value-form}), \OPn{\VAR{form}} must expand
510 into code returning \VAR{arg-vars}, \VAR{args}, \VAR{newval-vars},
511 \VAR{set-form}, and \VAR{get-form} as described with
512 \FU{GET-SETF-EXPANSION} where the elements of macro
513 lambda list \OPn{\VAR{macro-$\lambda$}} are bound to corresponding
514 \VAR{arg}s. \VAR{form}s are enclosed in an implicit \SO{block} \VAR{function}.
517 \IT{(\FU*{GET-SETF-EXPANSION} \VAR{place} \Op{\VAR{environment}})}
519 Return lists of temporary variables \retval{\VAR{arg-vars}} and of
520 corresponding \retvalii{\VAR{args}} as given with \VAR{place},
521 list \retvaliii{\VAR{\VAR{newval-vars}}} with temporary variables
522 corresponding to the new values, and \retvaln{4}{\VAR{set-form}}
523 and \retvaln{5}{get-form} specifying in terms of \VAR{arg-vars}
524 and \VAR{newval-vars} how to \kwd{setf} and how to read
525 \VAR{place}.
528 \IT{(\MC*{DEFINE-MODIFY-MACRO} \VAR{foo}
529 (\OP{\kwd*{\&optional} \xorGOO{%
530 \VAR{var}\\
531 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ }
532 \Op{\VAR{supplied-p}}})}{\}}}
533 \Op{\kwd*{\&rest} \VAR{var}})
534 \VAR{function} \Op{\NEV{\VAR{doc}}})}
536 Define macro \retval{\VAR{foo}} able to modify a place. On
537 invocation of (\VAR{foo} \VAR{place} \OPn{\VAR{arg}}), the value of
538 \VAR{function} applied to \VAR{place} and \VAR{arg}s will be stored into
539 \VAR{place} and returned.
542 \IT{\CNS*{LAMBDA-LIST-KEYWORDS}}
543 {List of macro lambda list keywords.
546 \end{LIST}
549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
550 \subsection{Control Flow}
551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
552 \begin{LIST}{1cm}
554 \IT{(\SO*{IF} \VAR{test} \VAR{then} \Op{\VAR{else}\DF{\NIL}})}
555 {Return value of
556 \retval{\VAR{then}} if \VAR{test} returns \T; return value of
557 \retval{\VAR{else}} otherwise.
560 \IT{(\MC*{COND} \OPn{(\VAR{test} \PROGN{\VAR{then}}\DF{\VAR{test}})})}
562 Return the \retval{values} of the first
563 \OPn{\VAR{then}} whose \VAR{test} returns \T; return
564 \retval{\NIL} if all \VAR{test}s return \NIL.
567 \IT{(\xorGOO{\MC*{WHEN}\\
568 \MC*{UNLESS}}{\}} \VAR{test}
569 \PROGN{\VAR{foo}}\DF{\NIL})}
571 Evaluate \VAR{foo}s and return \retval{their values} if \VAR{test}
572 returns \T\ or \NIL, respectively. Return \retval{\NIL} otherwise.
575 \IT{(\MC*{CASE} \VAR{test} \OPn{(\NEV{\VAR{keys}} \PROGN{\VAR{foo}})}
576 \Op{(\Goo{\T\XOR\kwd*{OTHERWISE}} \PROGN{\VAR{bar}})\DF{\NIL}})}
578 Return the \retval{values} of the first \OPn{\VAR{foo}} one of whose \VAR{keys} is
579 \kwd{eql} \VAR{test}.
580 Return \retval{values of \VAR{bar}s} if no element of \VAR{keys} matches.
583 \IT{(\Goo{\MC*{ECASE}\XOR\MC*{CCASE}} \VAR{test}
584 \OPn{(\NEV{\VAR{keys}} \PROGN{\VAR{foo}})})}
586 Return the \retval{values} of the first \OPn{\VAR{foo}} one of whose \VAR{keys} is \kwd{eql}
587 \VAR{test}. Signal non-correctable/correctable \kwd{type-error} and
588 return \retval{\NIL} if no element of \VAR{keys} matches.
591 \IT{(\MC*{AND} \OPn{\VAR{form}}\DF{\T})}
593 Evaluate \VAR{form}s from left to
594 right. Immediately return \retval{\NIL} if one \VAR{form}'s value is \NIL. Return
595 \retval{values of last \VAR{form}} otherwise.
598 \IT{(\MC*{OR} \OPn{\VAR{form}}\DF{\NIL})}
600 Evaluate \VAR{form}s from left to
601 right. Immediately return \retval{primary value} of first
602 non-\NIL-evaluating form, or \retval{all values} if last \VAR{form}
603 is reached. Return \retval{\NIL} if no \VAR{form} returns \T.
606 \IT{(\SO*{PROGN} \OPn{\VAR{form}}\DF{\NIL})}
607 {\label{:progn}
608 Evaluate \VAR{form}s sequentially. Return
609 \retval{values of last \VAR{form}}.
612 \IT{(\xorGOO{\MC*{PROG}\\
613 \MC*{PROG\A}}{\}}
614 (\orGOO{%
615 \VAR{var}\\
616 (\VAR{var } \Op{ \VAR{value}})}{\}^{\!\!*}})
617 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
618 \xorGOO{\NEV{\VAR{tag}}\\\VAR{form}}{\}^{\!\!*}})}
620 Evaluate \SO{TAGBODY}-like body with \VAR{var}s locally bound (in
621 parallel or sequentially, respectively) to \VAR{value}s. Return
622 \retval{\NIL} or explicitly \retval{\MC{return}ed value}.
623 Implicitly, the whole form is a \SO{block} named \NIL.
626 \IT{\arrGOO{%
627 (\SO*{MULTIPLE-VALUE-PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\
628 (\MC*{PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\
629 (\MC*{PROG2} \VAR{ form-a} \VAR{ form-r} \OPn{\VAR{ form}})}{.}}
631 Evaluate forms in order. Return \retval{values/1st value},
632 respectively, of \VAR{form-r}.
635 \IT{(\SO*{PROGV} \VAR{symbols} \VAR{values} \PROGN{\VAR{form}})}
637 Evaluate \VAR{form}s with \VAR{symbols} dynamically bound to \VAR{values} or
638 \NIL. Return \retval{values of \VAR{form}s}.
641 \IT{(\SO*{UNWIND-PROTECT} \VAR{protected} \OPn{\VAR{cleanup}})}
643 Evaluate \VAR{protected} and then, no matter how control leaves
644 \VAR{protected}, \VAR{cleanup}s. Return \retval{values of
645 \VAR{protected}}.
648 \IT{(\MC*{DESTRUCTURING-BIND} \VAR{destruct-$\lambda$} \VAR{bar} \OPn{(\kwd{declare}
649 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
651 Evaluate \VAR{form}s with variables from tree \VAR{destruct-$\lambda$} bound to
652 corresponding elements of tree \VAR{bar}, and return \retval{their
653 values}. \VAR{destruct-$\lambda$} resembles \VAR{macro-$\lambda$}
654 (section \ref{section:Macros}), but without any \kwd{\&environment}
655 clause.
658 \IT{(\MC*{MULTIPLE-VALUE-BIND} (\OPn{\NEV{\VAR{var}}}) \VAR{values-form}
659 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{body-form}})}
661 Evaluate
662 \VAR{body-form}s with \VAR{var}s bound to the return values of
663 \VAR{values-form}. Return \retval{values of \VAR{body-form}s}.
666 \IT{(\xorGOO{\SO*{LET}\\
667 \SO*{LET\A}}{\}}(%
668 \orGOO{\VAR{name}\\
669 (\VAR{name }\Op{\VAR{value}\DF{\NIL}})}{\}^{\!\!*}})
670 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
671 \PROGN{\VAR{form}})}
673 Evaluate \VAR{form}s with \VAR{name}s bound (in parallel or
674 sequentially, respectively) to \VAR{value}s. Return
675 \retval{values of \VAR{form}s}.
678 \IT{(\SO*{LOCALLY} \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
679 \PROGN{\VAR{form}})}
681 Evaluate \VAR{form}s with declarations \VAR{decl} in
682 effect. Return \retval{values of \VAR{form}s}.
685 \IT{(\SO*{BLOCK} \VAR{name} \PROGN{\VAR{form}})}
687 Evaluate \VAR{form}s with lexical scope and dynamic extent, and
688 return \retval{their values} unless interrupted by
689 \SO{RETURN-FROM}.
692 \IT{\arrGOO{(\SO*{RETURN-FROM } \VAR{foo } \Op{\VAR{result}\DF{\NIL}})\\
693 (\MC*{RETURN } \Op{\VAR{result}\DF{\NIL}})}{.}}
695 Have nearest enclosing \SO{block} named \VAR{foo}/named \NIL,
696 repectively, return with values of \VAR{result}.
699 \IT{(\SO*{TAGBODY} \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
701 Evaluate \VAR{form}s. \VAR{tag}s (symbols or integers) are targets
702 for \SO{GO}. Return \retval{\NIL}.
705 \IT{(\SO*{GO} \VAR{tag})}
706 {Jump within a \SO{tagbody} to nearest
707 lexically enclosing \kwd{eql} \VAR{tag}.
710 \IT{(\SO*{CATCH} \VAR{tag} \PROGN{\VAR{form}})}
712 Evaluate \VAR{form}s and return \retval{their values} unless
713 interrupted by \SO{THROW}.
716 \IT{(\SO*{THROW} \VAR{tag} \VAR{form})}
717 {Have the nearest dynamically
718 enclosing \SO{CATCH} with a tag \FU{eq} \VAR{tag} return with the
719 values of \VAR{form}.
722 \IT{(\FU*{SLEEP} \VAR{n})}
723 {Wait \VAR{n} seconds, return \retval{\NIL}.
726 \end{LIST}
729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
730 \subsection{Iteration}
731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
733 \begin{LIST}{1cm}
735 \IT{(\xorGOO{\MC*{DO}\\
736 \MC*{DO\A}}{\}}
737 (\xorGOO{%
738 \VAR{var}\\
739 (\VAR{var } \OP{ \VAR{start } \Op{\VAR{step}}})}{\}^{\!\!*}})
740 (\VAR{stop} \PROGN{\VAR{result}})
741 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
742 \xorGOO{\NEV{\VAR{tag}}\\\VAR{form}}{\}^{\!\!*}})}
744 Evaluate \SO{TAGBODY}-like body with \VAR{var}s successively bound according
745 to the values of the corresponding \VAR{start} and \VAR{step}
746 forms. \VAR{var}s are bound in parallel/sequentially, respectively.
747 Stop iteration when \VAR{stop} is \T. Return \retval{values of
748 \OPn{\VAR{result}}}. Implicitly, the whole form is a \SO{block}
749 named \NIL.
752 \IT{(\MC*{DOTIMES} (\VAR{var} \VAR{i} \Op{\VAR{result}})
753 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
754 \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
756 Evaluate \SO{TAGBODY}-like body with \VAR{var} successively bound
757 to integers from 0 to $i - 1$. Upon evaluation of
758 \retval{\VAR{result}}, \VAR{var} is \VAR{i}. Implicitly, the whole
759 form is a \SO{block} named \NIL.
762 \IT{(\MC*{DOLIST }(\VAR{var} \VAR{list} \Op{\VAR{result}})
763 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
764 \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
766 Evaluate \SO{TAGBODY}-like body with \VAR{var} successively bound
767 to the elements of \VAR{list}. Upon evaluation of
768 \retval{\VAR{result}}, \VAR{var} is \NIL. Implicitly, the whole form
769 is a \SO{block} named \NIL.
773 \end{LIST}
775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
776 \subsection{Loop Facility}
777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
779 %FIXME:DESTRUCTURING
780 \begin{figure}%
781 \begin{center}%
782 \begin{sideways}%
784 \arraycolsep0pt
786 \text{\kwd{loop}}\text{ }
787 \Op{
788 \text{\LKWD{named} \VAR{n}\DF{\NIL}}
790 \left\{
791 \begin{array}{l}
792 \text{\LKWD{with} \VAR{var-s} \Op{\VAR{type}} \LKWD{=} \VAR{foo }}
793 \{\text{\LKWD{and} \VAR{var-p} \Op{\VAR{type}} \LKWD{=}
794 \VAR{bar}\}}^{*} \\[.1ex]
795 \left.\!
796 \begin{array}{l}
797 \text{\LKWD{for}} \\
798 \text{\LKWD{as}}
799 \end{array}\right\}
800 \boxed{
801 \text{\VAR{var} [\VAR{type}]}
802 \left\{
803 \begin{array}{l}
804 \left.\!
805 \begin{array}{l}
806 \OP{
807 \left\{
808 \begin{array}{l}
809 \text{\LKWD{upfrom}}\\
810 \text{\LKWD{from}}
811 \end{array}
812 \right\}
813 \text{\VAR{start}\DF{\LIT{0}}}
814 }\text{ }
815 \OP{
816 \left\{
817 \begin{array}{l}
818 \text{\LKWD{upto}}\\
819 \text{\LKWD{to}}\\
820 \text{\LKWD{below}}
821 \end{array}
822 \right\}
823 \text{\VAR{form}}
825 \text{\LKWD{from} \VAR{start}}
826 \left\{
827 \begin{array}{l}
828 \text{\LKWD{downto}}\\
829 \text{\LKWD{above}}
830 \end{array}
831 \right\}
832 \text{\VAR{form }}\\
833 \text{\LKWD{downfrom} \VAR{start}}\text{ }
834 \OP{
835 \left\{
836 \begin{array}{l}
837 \text{\LKWD{downto}}\\
838 \text{\LKWD{to}}\\
839 \text{\LKWD{above}}
840 \end{array}
841 \right\}
842 \text{\VAR{form}}
844 \end{array}
845 \right\}
846 \Op{
847 \text{\LKWD{by} \VAR{step}\DF{\LIT{1}}}
849 \left.\!
850 \begin{array}{l}
851 \text{\LKWD{in}} \\
852 \text{\LKWD{on}}
853 \end{array}
854 \right\}
855 \text{\VAR{list}}\text{ }
856 \Op{
857 \text{\LKWD{by} \VAR{function}\DF{\kwd{cdr}}}
859 \text{\LKWD{=} \VAR{foo }}
860 \Op{
861 \text{\LKWD{then} \VAR{bar}}
863 \text{\LKWD{across} \VAR{vector}}\\
864 \text{\LKWD{being}}
865 \left\{
866 \begin{array}{l}
867 \text{\LKWD{the}}\\
868 \text{\LKWD{each}}
869 \end{array}
870 \right\}%
871 \left\{
872 \begin{array}{{l}}
873 \left.\!
874 \begin{array}{l}
875 \left.\!
876 \begin{array}{l}
877 \text{\LKWD{hash-key}}\\
878 \text{\LKWD{hash-keys}}
879 \end{array}
880 \right\}%
881 \left\{
882 \begin{array}{l}
883 \text{\LKWD{of}}\\
884 \text{\LKWD{in}}
885 \end{array}
886 \right\}
887 \text{\VAR{hash }}
888 \Op{
889 \text{\LKWD{using} (\LKWD{hash-value} \VAR{v})}%
891 \left.\!
892 \begin{array}{l}
893 \text{\LKWD{hash-value}}\\
894 \text{\LKWD{hash-values}}
895 \end{array}
896 \right\}%
897 \left\{
898 \begin{array}{l}
899 \text{\LKWD{of}}\\
900 \text{\LKWD{in}}
901 \end{array}
902 \right\}
903 \text{\VAR{hash }}
904 \Op{
905 \text{\LKWD{using} (\LKWD{hash-key} \VAR{k})}%
907 \end{array}
908 \right.\\
909 \left.\!
910 \begin{array}{l}
911 \text{\LKWD{symbol\Op{s}}}\\
912 \text{\LKWD{present-symbol\Op{s}}}\\
913 \text{\LKWD{external-symbol\Op{s}}}
914 \end{array}
915 \right\}%
916 \OP{
917 \left\{
918 \begin{array}{l}
919 \text{\LKWD{of}}\\
920 \text{\LKWD{in}}
921 \end{array}
922 \right\} \text{\VAR{package}\DF{\V{\A package\A}}}%
924 \end{array}\!\!%
925 \right.%
926 \end{array}%
927 \right\}_{\displaystyle{\mathbb{F}_0}}
928 }%boxed
929 \left\{
930 \text{\LKWD{and} }\boxed{\mathbb{F}_i\!}
931 \right\}^{\!*}\\
932 \\[-2.4ex]
933 \left.\!%
934 \begin{array}{l}
935 \text{\LKWD{initially}} \\
936 \text{\LKWD{finally}}
937 \end{array}
938 \right\}
939 \text{\VAR{form}}^{+} \\
941 \end{array}
942 \right\}^{\!\!\displaystyle{*}}
943 %Bottleneck
944 \left\{
945 \begin{array}{l}
946 \text{\LKWD{repeat} \VAR{num}}\\
947 \left.\!
948 \begin{array}{l}
949 \text{\LKWD{while}}\\
950 \text{\LKWD{until}}\\
951 \text{\LKWD{always}}\\
952 \text{\LKWD{never}}\\
953 \text{\LKWD{thereis}}
954 \end{array}
955 \right\}
956 \text{\VAR{test}}\\
957 \boxed{
958 \left.\!
959 \begin{array}{l}
960 \left.\!
961 \begin{array}{l}
962 \text{\LKWD{do}}\\
963 \text{\LKWD{doing}}
964 \end{array}
965 \right\}
966 \text{\VAR{form}}^{+}\\
967 \text{\LKWD{return}}
968 \left\{
969 \begin{array}{l}
970 \text{\VAR{form}}\\
971 \text{\LKWD{it}}
972 \end{array}
973 \right.\\
974 \left.\!
975 \begin{array}{l}
976 \text{\LKWD{collect\Op{ing}}}\\
977 \text{\LKWD{append\Op{ing}}}\\
978 \text{\LKWD{nconc\Op{ing}}}
979 \end{array}
980 \right\}
981 \left\{
982 \begin{array}{l}
983 \text{\VAR{form}}\\
984 \text{\LKWD{it}}
985 \end{array}
986 \right\} \Op{\text{\LKWD{into }\VAR{list}}}\\
987 \left.\!
988 \begin{array}{l}
989 \text{\LKWD{count\Op{ing}}}\\
990 \text{\LKWD{sum\Op{ming}}}\\
991 \text{\LKWD{maximize}}\\
992 \text{\LKWD{maximizing}}\\
993 \text{\LKWD{minimize}}\\
994 \text{\LKWD{minimizing}}
995 \end{array}
996 \right\}
997 \left\{
998 \begin{array}{l}
999 \text{\VAR{form}}\\
1000 \text{\LKWD{it}}
1001 \end{array}
1002 \right\}
1003 \Op{\text{\LKWD{into }\VAR{num}}}\text{ }
1004 \Op{\text{\VAR{type}}}\\
1005 \left.\!
1006 \begin{array}{l}
1007 \text{\LKWD{if}}\\
1008 \text{\LKWD{when}}\\
1009 \text{\LKWD{unless}}
1010 \end{array}
1011 \right\}%
1012 \text{\VAR{test }}
1013 \boxed{\mathbb{C}_i\!}\{\text{\LKWD{and}}\,
1014 \boxed{\mathbb{C}_j\!}\}^{*}\Op{\text{\LKWD{else}}\,
1015 \boxed{\mathbb{C}_k\!}\{\text{\LKWD{and}}\,
1016 \boxed{\mathbb{C}_l\!}\}^{*}}
1017 \Op{\text{\LKWD{end}}}
1018 \end{array}
1019 \right._{\!\!\!\!\displaystyle{\mathbb{C}_0}}
1020 }%boxed
1022 \\[-2.4ex]
1023 \left.\!
1024 \begin{array}{l}
1025 \text{\LKWD{initially}} \\
1026 \text{\LKWD{finally}}
1027 \end{array}
1028 \right\}
1029 \text{\VAR{form}}^{+}
1030 \end{array}
1031 \right\}^{\displaystyle{\!\!*}}
1033 \!)%
1034 \end{sideways}%
1035 \end{center}\vspace{-2em}
1036 \raisebox{0em}[0em][0em]{\parbox[b]{4cm}{\caption{\protect\raggedright Loop Facility, Overview.\label{loop-overview}}}}
1037 \end{figure}
1040 \begin{LIST}{1cm}
1042 \IT{(\MC*{LOOP} \OPn{\VAR{form}})}
1044 Simple Loop. If \VAR{form}s do not contain any atomic Loop Facility
1045 keywords, evaluate them forever in an implicit \SO{block} named \NIL.
1048 \IT{(\MC*{LOOP} \OPn{\VAR{form}})}
1050 Loop Facility. For Loop Facility keywords
1051 see below and Figure \ref{loop-overview}.
1054 \begin{LIST}{.5cm}
1056 \IT{\LKWD*{named} \VAR{n}\DF{\NIL}}
1058 Give \MC{loop}'s implicit \SO{block} a name.
1061 \IT{\Goop{\LKWD*{with} \VAR{var-s} \Op{\VAR{type}} \LKWD*{=} \VAR{foo}} \Goos{\LKWD*{and}
1062 \VAR{var-p} \Op{\VAR{type}} \LKWD*{=} \VAR{bar}}}
1064 Initialize local variables \VAR{var-s} sequentially and \VAR{var-p} in parallel.
1067 \IT{\Goo{\LKWD*{initially}\XOR\LKWD*{finally}} \RP{\VAR{form}}}
1069 Evaluate \VAR{form}s before begin, or after end, respectively, of iterations.
1072 \IT{\GOo{\Goo{\LKWD*{for}\XOR\LKWD*{as}} \XOR\ \LKWD*{and}} \VAR{var} \Op{\VAR{type}}}
1074 Begin of iteration control clauses; \VAR{var}s are initialized and
1075 stepped sequentially/in parallel, respectively.
1078 \begin{LIST}{.5cm}
1080 \IT{\Goo{\LKWD*{upfrom}\XOR\LKWD*{from}\XOR\LKWD*{downfrom}}
1081 \VAR{start}}
1083 Start stepping with \VAR{start}
1086 \IT{\Goo{\LKWD*{upto}\XOR\LKWD*{downto}\XOR\LKWD*{to}\XOR\LKWD*{below}\XOR\LKWD*{above}}
1087 \VAR{form}}
1089 Specify \VAR{form} as the end value for stepping.
1092 \IT{\Goo{\LKWD*{in}\XOR\LKWD*{on}} \VAR{list}}
1094 Bind \VAR{var} to successive elements/tails, respectively, of \VAR{list}.
1097 \IT{\LKWD*{by} \Goo{\VAR{step}\DF{\LIT{1}}\XOR\VAR{function}\DF{\FU{cdr}}}}
1099 Specify the (positive) decrement or increment or the
1100 \VAR{function} of one argument returning the next part of the list.
1103 \IT{\LKWD*{=} \VAR{foo} \Op{\LKWD*{then}
1104 \VAR{bar}\DF{\VAR{foo}}}}
1106 Bind \VAR{var} in the first iteration to \VAR{foo} and later to \VAR{bar}.
1109 \IT{\LKWD*{across} \VAR{vector}}
1111 Bind \VAR{var} to successive elements of \VAR{vector}.
1114 \IT{\LKWD*{being} \Goo{\LKWD*{the}\XOR\LKWD*{each}}}
1116 Iterate over a hash table or a package.
1119 \begin{LIST}{.5cm}
1121 \IT{\Goo{\LKWD*{hash-key}\XOR\LKWD*{hash-keys}} \Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table}
1122 \Op{\LKWD*{using} (\LKWD*{hash-value} \VAR{value})}}
1124 Bind \VAR{var} successively to the keys of \VAR{hash-table}; bind \VAR{value} to corresponding values.
1127 \IT{\Goo{\LKWD*{hash-value}\XOR\LKWD*{hash-values}} \Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table}
1128 \Op{\LKWD*{using} (\LKWD*{hash-key} \VAR{key})}}
1130 Bind \VAR{var} successively to the values of \VAR{hash-table}; bind \VAR{key} to corresponding keys.
1133 \IT{\Goo{\LKWD*{symbol}\XOR\LKWD*{symbols}\XOR\LKWD*{present-symbol}\XOR\LKWD*{present-symbols}\XOR\LKWD*{external-symbol}\XOR\LKWD*{external-symbols}}
1134 \Op{\Goo{\LKWD*{of}\XOR\LKWD*{in}}
1135 \VAR{package}\DF{\V{\A package\A}}}}
1137 Bind \VAR{var} successively to the symbols, or the present
1138 symbols, or the external symbols respectively, of
1139 \VAR{package}.
1142 \end{LIST}
1143 \end{LIST}
1145 \IT{\Goo{\LKWD*{do}\XOR\LKWD*{doing}} \RP{\VAR{form}}}
1147 Evaluate \VAR{form}s in every iteration.
1150 \IT{\LKWD*{it}}
1152 Value of \VAR{test} form of an enclosing \LKWD{if},
1153 \LKWD{when}, \LKWD{unless}, or \LKWD{else} clause.
1156 \IT{\LKWD*{return} \Goo{\VAR{form}\XOR\LKWD*{it}}}
1158 Return immediately, skipping any \LKWD{finally} parts, with value of \VAR{form} or \LKWD{it}.
1161 \IT{\Goo{\LKWD*{collect}\XOR\LKWD*{collecting}}
1162 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into} \VAR{list}}}
1164 Collect values of \VAR{form} or \LKWD{it} into \VAR{list}. If no
1165 \VAR{list} is given, collect into an anonymous list which is
1166 returned after termination.
1169 \IT{\Goo{\LKWD*{append}\XOR\LKWD*{appending}\XOR\LKWD*{nconc}\XOR\LKWD*{nconcing}}
1170 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1171 \VAR{list}}}
1173 Concatenate values of \VAR{form} or \LKWD{it}, which should be
1174 lists, into \VAR{list} by the means of \FU{append} or \FU{nconc},
1175 respectively. If no \VAR{list} is given, collect into an
1176 anonymous list which is returned after termination.
1179 \IT{\Goo{\LKWD*{count}\XOR\LKWD*{counting}}
1180 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1181 \VAR{n}} \Op{\VAR{type}}}
1183 Count the number of times the value of \VAR{form} or of \LKWD{it} is \T.
1184 If no \VAR{n} is given, count into an anonymous variable
1185 which is returned after termination.
1188 \IT{\Goo{\LKWD*{sum}\XOR\LKWD*{summing}}
1189 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1190 \VAR{sum}} \Op{\VAR{type}}}
1192 Calculate the sum of the values of \VAR{form} or of \LKWD{it}.
1193 If no \VAR{sum} is given, sum into an anonymous variable
1194 which is returned after termination.
1197 \IT{\Goo{\LKWD*{maximize}\XOR\LKWD*{maximizing}\XOR
1198 \LKWD*{minimize}\XOR
1199 \LKWD*{minimizing}} \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1200 \VAR{max-min}} \Op{\VAR{type}}}
1202 Determine the maximum or minimum, respectively, of the values of
1203 \VAR{form} or of \LKWD{it}.
1204 If no \VAR{max-min} is given, use an anonymous variable
1205 which is returned after termination.
1208 \IT{\Goo{\LKWD*{if}\XOR\LKWD*{when}\XOR\LKWD*{unless}} \VAR{ test}
1209 \VAR{i-form} \Goos{\LKWD*{and}
1210 \VAR{j-form}} \Op{\LKWD*{else} \VAR{k-form} \Goos{\LKWD*{and}
1211 \VAR{l-form}}} \Op{\LKWD*{end}}}
1213 If \VAR{test} returns \T, \T, or \NIL, respectively, evaluate
1214 \VAR{i-form} and \VAR{j-form}s; otherwise, evaluate \VAR{k-form}
1215 and \VAR{l-form}s. Inside \VAR{i-form} and \VAR{k-form}, the value
1216 of \VAR{test} is accessible by \LKWD*{it}.
1219 \IT{\LKWD*{repeat} \VAR{num}}
1221 Terminate \MC{loop} after \VAR{num} times; \VAR{num} is evaluated once.
1224 \IT{\Goo{\LKWD*{while}\XOR\LKWD*{until}} \VAR{test}}
1226 Continue iteration until \VAR{test} returns \NIL\ or \T, respectively.
1229 \IT{\Goo{\LKWD*{always}\XOR\LKWD*{never}} \VAR{test}}
1231 Terminate \MC{loop} returning \NIL\ and skipping any
1232 \LKWD{finally} parts as soon as \VAR{test} is \NIL\ or \T,
1233 respectively. Otherwise continue \MC{loop} with its default return
1234 value set to \T.
1237 \IT{\LKWD*{thereis} \VAR{test}}
1239 Terminate \MC{loop} when \VAR{test} is \T\ and return value of
1240 \VAR{test}, skipping any \LKWD{finally} parts. Otherwise continue
1241 \MC{loop} with its default return value set to \NIL.
1244 \IT{\LKWD*{loop-finish}}
1246 Terminate \MC{loop} immediately returning any accumulated results.
1248 \end{LIST}
1249 \end{LIST}
1254 % LocalWords: pt