minor bugfixes; changes to html
[clqr.git] / clqr-control-structure.tex
blob1019a987ad27e7406641fca05493e897aded98d3
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 equivalent \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 type 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{foo})}
53 \retval{\T} if \VAR{foo} is \NIL, \retval{\NIL} otherwise.
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} \xorGOO{\VAR{foo}\\
72 (\kwd{setf } \VAR{foo})}{\}})}
74 \retval{\T} if \VAR{foo} is a global function or macro.
78 \end{LIST}
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82 \subsection{Variables}
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 \begin{LIST}{1cm}
87 \IT{(\xorGOO{%
88 \MC*{DEFCONSTANT}\\
89 \MC*{DEFPARAMETER}}{\}} \NEV{\VAR{foo}} \VAR{form}
90 \Op{\NEV{\VAR{doc}}})}
92 Assign value of \VAR{form} to global constant/dynamic variable \retval{\VAR{foo}}.
95 \IT{(\MC*{DEFVAR} \NEV{\VAR{foo}} \OP{\VAR{form}
96 \Op{\NEV{\VAR{doc}}}})}
98 Unless bound already, assign value of \VAR{form} to dynamic variable
99 \retval{\VAR{foo}}.
102 \IT{(\xorGOO{\MC*{SETF}\\
103 \MC*{PSETF}}{\}} \Goos{\VAR{place}
104 \VAR{form}})}
106 Set \VAR{place}s to primary values of \VAR{form}s. Return \retval{values
107 of last \VAR{form}}/\retval{\NIL}; work sequentially/in parallel, respectively.
110 \IT{(\xorGOO{\SO*{SETQ}\\
111 \MC*{PSETQ}}{\}} \Goos{\VAR{symbol}
112 \VAR{form}})}
114 Set \VAR{symbol}s to primary values of \VAR{form}s. Return \retval{value
115 of last \VAR{form}}/\retval{\NIL}; work sequentially/in parallel, respectively.
118 \IT{(\FU*{SET} \DES{\VAR{symbol}} \VAR{foo})}
120 Set \VAR{symbol}'s value cell to \retval{\VAR{foo}}. Deprecated.
123 \IT{(\MC*{MULTIPLE-VALUE-SETQ} \VAR{vars} \VAR{form})}
125 Set elements of \VAR{vars} to the values of
126 \VAR{form}. Return \retval{\VAR{form}'s primary value}.
129 \IT{(\MC*{SHIFTF} \RP{\DES{\VAR{place}}} \VAR{foo})}
131 Store value of \VAR{foo} in rightmost \VAR{place} shifting values of
132 \VAR{place}s left, returning \retval{first \VAR{place}}.
135 \IT{(\MC*{ROTATEF} \OPn{\DES{\VAR{place}}})}
137 Rotate values of \VAR{place}s left, old first becoming new last
138 \VAR{place}'s value. Return \retval{\NIL}.
141 \IT{(\FU*{MAKUNBOUND} \DES{\VAR{foo}})}
143 Delete special variable \retval{\VAR{foo}} if any.
146 \label{:property_lists}
147 \IT{\arrGOO{(\FU*{GET} \VAR{ symbol} \VAR{ key }
148 \OP{\VAR{default}\DF{\NIL}})\\
149 (\FU*{GETF} \VAR{ place} \VAR{ key }
150 \OP{\VAR{default}\DF{\NIL}})}{.}}
152 \retval{First entry \VAR{key}} from property list stored in
153 \VAR{symbol}/in \VAR{place}, respectively, or \retval{\VAR{default}} if
154 there is no \VAR{key}. \kwd{setf}able.
157 \IT{(\FU*{GET-PROPERTIES} \VAR{property-list} \VAR{keys})}
159 Return \retval{key} and \retvalii{value} of first entry from \VAR{property-list}
160 matching a key from \VAR{keys}, and \retvaliii{tail of
161 \VAR{property-list}} starting with that key. Return \retval{\NIL},
162 \retvalii{\NIL}, and \retvaliii{\NIL} if there was no matching key
163 in \VAR{property-list}.
166 \IT{\arrGOO{(\FU*{REMPROP } \DES{\VAR{symbol}} \VAR{ key})\\
167 (\MC*{REMF } \DES{\VAR{place}} \VAR{ key})}{.}}
169 Remove first entry \VAR{key} from property list stored in
170 \VAR{symbol}/in \VAR{place}, respectively. Return \retval{\T} if \VAR{key}
171 was there, or \retval{\NIL} otherwise.
174 \end{LIST}
177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178 \subsection{Functions}
179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180 \label{section:Functions}
182 \begin{flushleft}
183 Below, ordinary lambda list (\OPn{\VAR{ord-$\lambda$}}) has the form\\
184 % \VAR{var} referenced from DEFSTRUCT
185 (\OPn{\VAR{var}}
186 \OP{\kwd*{\&optional} \xorGOO{%
187 \VAR{var}\\
188 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}}}
189 \penalty-5
190 \Op{\kwd*{\&rest} \VAR{var}}
191 \penalty-5
192 \OP{\kwd*{\&key} \xorGOO{%
193 \VAR{var}\\
194 (\xorGOO{%
195 \VAR{var}\\
196 (\kwd{:}\VAR{key } \VAR{var})}{\}}
197 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ }\Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
198 \penalty-5
199 \Op{\kwd*{\&allow-other-keys}}}
200 \penalty-5
201 \OP{\kwd*{\&aux} \xorGOO{%
202 \VAR{var}\\
203 (\VAR{var } \Op{\VAR{init}\DF{\NIL}})}{\}}}).\\
204 \VAR{supplied-p} is \T\ if there is a corresponding
205 argument. \VAR{init} forms can refer to any \VAR{init} and
206 \VAR{supplied-p} to their left.
207 \end{flushleft}
209 \begin{LIST}{1cm}
211 \IT{(\xorGOO{\MC*{DEFUN }\xorGOO{\VAR{foo}\\
212 (\kwd{setf} \VAR{ foo})}{.}\\
213 \MC*{LAMBDA}}{\}}
214 (\VAR{\OPn{ord-$\lambda$}}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
215 \Op{\NEV{\VAR{doc}}}
216 \PROGN{\VAR{form}})}
218 Define a function named \retval{\VAR{foo}} or \retval{(\kwd{setf}
219 \VAR{foo})}, or an anonymous \retval{function}, respectively, which applies
220 \VAR{form}s to \VAR{ord-$\lambda$}s. For \MC{defun}, \VAR{form}s are
221 enclosed in an implicit \SO{block} \VAR{foo}.
224 \IT{(\xorGOO{\SO*{FLET}\\
225 \SO*{LABELS}}{\}}
226 (\OPn{(\xorGOO{\VAR{foo}\\
227 (\kwd{setf} \VAR{ foo})}{\}}
228 (\OPn{\VAR{ord-$\lambda$}})
229 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{local-decl}}})}
230 \Op{\NEV{\VAR{doc}}}
231 \PROGN{\VAR{local-form}})}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
232 \PROGN{\VAR{form}})}
234 Evaluate \VAR{form}s with
235 locally defined functions \VAR{foo}. Each \VAR{foo} is also the name
236 of an implicit \SO{block} around its corresponding
237 \OPn{\VAR{local-form}}. Only for \SO{LABELS}, functions \VAR{foo} are visible inside \VAR{local-forms}. Return
238 \retval{values of \VAR{form}s}.
241 \IT{(\SO*{FUNCTION} \xorGOO{%
242 \VAR{foo}\\
243 (\MC{lambda } \OPn{\VAR{form}})}{\}})}
245 Return lexically innermost \retval{function} named \VAR{foo} or a
246 lexical closure of the \retval{\MC{lambda} expression}.
249 \IT{(\FU*{APPLY} \xorGOO{\VAR{function}\\
250 (\kwd{setf } \VAR{function})}{\}} \RP{\VAR{arg}})}
252 Return \retval{values of \VAR{function}} called on
253 \VAR{arg}s. Last \VAR{arg} must be a list. \kwd{setf}able if
254 \VAR{function} is one of \FU{aref}, \FU{bit}, and \FU{sbit}.
257 \IT{(\FU*{FUNCALL} \VAR{function} \OPn{arg})}
259 Return \retval{values of \VAR{function}} called with \VAR{arg}s.
262 \IT{(\SO*{MULTIPLE-VALUE-CALL} \VAR{foo} \OPn{\VAR{form}})}
263 {Call function
264 \VAR{foo} with all the values of each \VAR{form} as its arguments. Return
265 \retval{values returned by \VAR{foo}}.
268 \IT{(\FU*{VALUES-LIST} \VAR{list})}
270 Return \retval{elements of \VAR{list}}.
273 \IT{(\FU*{VALUES} \OPn{\VAR{foo}})}
275 Return as multiple values the \retval{primary values} of the
276 \VAR{foo}s. \kwd{setf}able.
279 \IT{(\FU*{MULTIPLE-VALUE-LIST} \VAR{form})}
281 Return in a \retval{list} values of \VAR{form}.
284 \IT{(\MC*{NTH-VALUE} \VAR{n} \VAR{form})}
286 Zero-indexed \retval{\VAR{n}th return value} of \VAR{form}.
289 \IT{(\FU*{COMPLEMENT} \VAR{function})}
291 Return \retval{new function} with same arguments and same side effects
292 as \VAR{function}, but with complementary truth value.
295 \IT{(\FU*{CONSTANTLY} \VAR{foo})}
297 Return \retval{function} of any number of arguments returning \VAR{foo}.
300 \IT{(\FU*{IDENTITY} \VAR{foo})}
302 Return \retval{\VAR{foo}}.
305 \IT{(\FU*{FUNCTION-LAMBDA-EXPRESSION} \VAR{function})}
307 If available, return \retval{lambda expression} of \VAR{function},
308 \retvalii{\NIL} if \VAR{function} was defined in an environment
309 without bindings, and \retvaliii{name} of \VAR{function}.
312 \IT{(\FU*{FDEFINITION} \xorGOO{\VAR{foo}\\
313 (\kwd{setf } \VAR{foo})}{\}})}
315 \retval{Definition} of global function \VAR{foo}. \kwd{setf}able.
318 \IT{(\FU*{FMAKUNBOUND} \VAR{foo})}
320 Remove global function or macro definition \retval{\VAR{foo}}.
323 \IT{\arrGOO{\CNS*{CALL-ARGUMENTS-LIMIT}\\
324 \CNS*{LAMBDA-PARAMETERS-LIMIT}}{.}}
326 Upper bound of the number of function arguments or lambda list
327 parameters, respectively; $\geq50$.
330 \IT{\CNS*{MULTIPLE-VALUES-LIMIT}}
332 Upper bound of the number of values a multiple value can have;
333 $\geq20$.
336 \end{LIST}
339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340 \subsection{Macros}
341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
342 \label{section:Macros}
344 \begin{flushleft}
345 Below, macro lambda list (\OPn{\VAR{macro-$\lambda$}}) has the form of
346 either
347 \penalty-5
348 (\Op{\kwd*{\&whole} \VAR{var}}
349 \penalty-5
350 \Op{\VAR{E}}
351 \penalty-5
352 \xorGOO{%
353 \VAR{var}\\
354 (\OPn{\VAR{macro-$\lambda$}})}{\}^{\!\!*}}
355 \penalty-5
356 \Op{\VAR{E}}
357 \penalty-5
358 \Op{\kwd*{\&optional}
359 \xorGOO{%
360 \VAR{var}\\
361 (\xorGOO{%
362 \VAR{var}\\
363 (\OPn{\VAR{macro-$\lambda$}})}{\}}\text{ }
364 \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}}
365 \penalty-5
366 \Op{\VAR{E}}
367 \penalty-5
368 \Op{%
369 \xorGOO{%
370 \kwd*{\&rest}\\
371 \kwd*{\&body}}{\}}
372 \xorGOO{%
373 \VAR{var}\\
374 (\OPn{\VAR{macro-$\lambda$}})}{\}}}
375 \penalty-5
376 \Op{\VAR{E}}
377 \penalty-5
378 \OP{\kwd*{\&key}
379 \xorGOO{%
380 \VAR{var}\\
381 (\xorGOO{%
382 \VAR{var}\\
383 (\kwd{:}\VAR{key } \xorGOO{%
384 \VAR{var}\\
385 (\OPn{\VAR{macro-$\lambda$}})}{\}})}{\}}
386 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
387 \Op{\VAR{E}}
388 \Op{\kwd*{\&allow-other-keys}}}
389 \penalty-5
390 \Op{\kwd*{\&aux}
391 \xorGOO{%
392 \VAR{var}\\
393 (\VAR{var } \Op{\VAR{init}\DF{\NIL}})}{\}^{\!\!*}}}
394 \penalty-5
395 \Op{\VAR{E}})
398 \penalty-5
399 (\Op{\kwd*{\&whole}
400 \VAR{var}}
401 \penalty-5
402 \Op{\VAR{E}}
403 \penalty-5
404 \xorGOO{%
405 \VAR{var}\\
406 (\OPn{\VAR{macro-$\lambda$}})}{\}^{\!\!*}}
407 \penalty-5
408 \Op{\VAR{E}}
409 \penalty-5
410 \Op{\kwd*{\&optional}
411 \xorGOO{%
412 \VAR{var}\\
413 (\xorGOO{%
414 \VAR{var}\\
415 (\OPn{\VAR{macro-$\lambda$}})}{\}}\text{ }
416 \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}}
417 \penalty-5
418 \Op{\VAR{E}}
419 \kwd{.}
420 \VAR{var}).
421 \penalty-5
422 \end{flushleft}
423 One toplevel \Op{\VAR{E}} may be replaced by \kwd*{\&environment}
424 \VAR{var} where \VAR{var} carries the lexical compilation
425 environment. \VAR{supplied-p} is \T\ if there is a corresponding
426 argument.
428 \begin{LIST}{1cm}
430 \IT{(\xorGOO{\MC*{DEFMACRO}\\
431 \FU*{DEFINE-COMPILER-MACRO}}{\}}
432 \xorGOO{\VAR{foo}\\
433 (\kwd{setf } \VAR{foo})}{\}}
434 (\OPn{\VAR{macro-$\lambda$}})
435 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
436 \PROGN{\VAR{form}})}
438 Define macro \retval{\VAR{foo}} which on evaluation as (\VAR{foo}
439 \VAR{tree}) applies expanded \VAR{form}s to arguments from
440 \VAR{tree} which corresponds to \VAR{tree}-shaped
441 \VAR{macro-$\lambda$}s. \VAR{form}s are enclosed in an implicit
442 \SO{block} \VAR{foo}.
445 \IT{(\MC*{DEFINE-SYMBOL-MACRO} \VAR{foo} \VAR{form})}
447 Define symbol macro \retval{\VAR{foo}} which on evaluation evaluates
448 expanded \VAR{form}.
451 \IT{(\SO*{MACROLET} (\OPn{(\VAR{foo} (\OPn{\VAR{macro-$\lambda$}})
452 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{local-decl}}})}
453 \Op{\NEV{\VAR{doc}}} \PROGN{\VAR{macro-form}})}) \OPn{(\kwd{declare}
454 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
456 Evaluate \retval{\VAR{form}s} with locally defined mutually
457 invisible macros \VAR{foo} which are enclosed in implicit \SO{block}s
458 of the same name.
461 \IT{(\SO*{SYMBOL-MACROLET} (\OPn{(\VAR{foo}
462 \VAR{expansion-form})}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
463 \PROGN{\VAR{form}})}
465 Evaluate \retval{\VAR{form}s} with locally defined symbol macros
466 \VAR{foo}.
469 \IT{(\MC*{DEFSETF} \NEV{\VAR{function}} \xorGOO{%
470 \NEV{\VAR{updater}} \text{ } \Op{\NEV{\VAR{doc}}}\\
471 (\OPn{\VAR{setf-$\lambda$}}) \text{ } (\OPn{\VAR{s-var}}) \text{ }
472 \OPn{(\kwd{declare } \OPn{\NEV{\VAR{decl}}})}\text{ }
473 \Op{\NEV{\VAR{doc}}} \text{ } \PROGN{\VAR{form}}}{\}})
474 \penalty-5
475 where defsetf lambda list (\OPn{\VAR{setf-$\lambda$}}) has the form
476 \penalty-5
477 (\OPn{\VAR{var}}
478 \OP{\kwd*{\&optional} \xorGOO{%
479 \VAR{var}\\
480 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}}}
481 \penalty-5
482 \Op{\kwd*{\&rest} \VAR{var}}
483 \penalty-5
484 \OP{\kwd*{\&key} \xorGOO{%
485 \VAR{var}\\
486 (\xorGOO{%
487 \VAR{var}\\
488 (\kwd{:}\VAR{key } \VAR{var})}{\}}
489 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ }\Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
490 \penalty-5
491 \Op{\kwd*{\&allow-other-keys}}}
492 \penalty-5
493 \OP{\kwd*{\&environment} \VAR{var}}%
497 Specify how to \kwd{setf} a place accessed by
498 \retval{\VAR{function}}.
499 Short form: (\kwd{setf} (\VAR{function} \OPn{\VAR{arg}}) \VAR{value-form}) is
500 replaced by (\VAR{updater} \OPn{\VAR{arg}} \VAR{value-form}).
501 Long form: on invocation of (\kwd{setf} (\VAR{function}
502 \OPn{\VAR{arg}}) \VAR{value-form}), \VAR{form}s must expand
503 into code that sets the place accessed where \VAR{setf-$\lambda$}
504 and \OPn{\VAR{s-var}} describe the arguments of \VAR{function} and
505 the value(s) to be stored, respectively; and that returns
506 the value(s) of \OPn{\VAR{s-var}}. \VAR{form}s are enclosed in an
507 implicit \SO{block} named \VAR{function}.
510 \IT{(\MC*{DEFINE-SETF-EXPANDER} \VAR{function}
511 (\OPn{\VAR{macro-$\lambda$}})
512 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
513 \PROGN{\VAR{form}})}
515 Specify how to \kwd{setf} a place accessed by
516 \retval{\VAR{function}}. On invocation of (\kwd{setf} (\VAR{function}
517 \OPn{\VAR{arg}}) \VAR{value-form}), \OPn{\VAR{form}} must expand
518 into code returning \VAR{arg-vars}, \VAR{args}, \VAR{newval-vars},
519 \VAR{set-form}, and \VAR{get-form} as described with
520 \FU{GET-SETF-EXPANSION} where the elements of macro
521 lambda list \OPn{\VAR{macro-$\lambda$}} are bound to corresponding
522 \VAR{arg}s. \VAR{form}s are enclosed in an implicit \SO{block} \VAR{function}.
525 \IT{(\FU*{GET-SETF-EXPANSION} \VAR{place} \Op{\VAR{environment}\DF{\NIL}})}
527 Return lists of temporary variables \retval{\VAR{arg-vars}} and of
528 corresponding \retvalii{\VAR{args}} as given with \VAR{place},
529 list \retvaliii{\VAR{\VAR{newval-vars}}} with temporary variables
530 corresponding to the new values, and \retvaln{4}{\VAR{set-form}}
531 and \retvaln{5}{\VAR{get-form}} specifying in terms of \VAR{arg-vars}
532 and \VAR{newval-vars} how to \kwd{setf} and how to read
533 \VAR{place}.
536 \IT{(\MC*{DEFINE-MODIFY-MACRO} \VAR{foo}
537 (\OP{\kwd*{\&optional} \xorGOO{%
538 \VAR{var}\\
539 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ }
540 \Op{\VAR{supplied-p}}})}{\}}}
541 \Op{\kwd*{\&rest} \VAR{var}})
542 \VAR{function} \Op{\NEV{\VAR{doc}}})}
544 Define macro \retval{\VAR{foo}} able to modify a place. On
545 invocation of (\VAR{foo} \VAR{place} \OPn{\VAR{arg}}), the value of
546 \VAR{function} applied to \VAR{place} and \VAR{arg}s will be stored into
547 \VAR{place} and returned.
550 \IT{\CNS*{LAMBDA-LIST-KEYWORDS}}
551 {List of macro lambda list keywords.
554 \end{LIST}
557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
558 \subsection{Control Flow}
559 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
560 \begin{LIST}{1cm}
562 \IT{(\SO*{IF} \VAR{test} \VAR{then} \Op{\VAR{else}\DF{\NIL}})}
564 Return values of \retval{\VAR{then}} if \VAR{test} returns \T;
565 return values of \retval{\VAR{else}} otherwise.
568 \IT{(\MC*{COND} \OPn{(\VAR{test} \PROGN{\VAR{then}}\DF{\VAR{test}})})}
570 Return the \retval{values} of the first
571 \OPn{\VAR{then}} whose \VAR{test} returns \T; return
572 \retval{\NIL} if all \VAR{test}s return \NIL.
575 \IT{(\xorGOO{\MC*{WHEN}\\
576 \MC*{UNLESS}}{\}} \VAR{test}
577 \PROGN{\VAR{foo}})}
579 Evaluate \VAR{foo}s and return \retval{their values} if \VAR{test}
580 returns \T\ or \NIL, respectively. Return \retval{\NIL} otherwise.
583 \IT{(\MC*{CASE} \VAR{test} \OPn{(\NEV{\VAR{keys}} \PROGN{\VAR{foo}})}
584 \OP{(\xorGOO{\kwd*{OTHERWISE}\\
585 \T}{\}} \PROGN{\VAR{bar}})\DF{\NIL}})}
587 Return the \retval{values} of the first \OPn{\VAR{foo}} one of whose \VAR{keys} is
588 \kwd{eql} \VAR{test}.
589 Return \retval{values of \VAR{bar}s} if no element of \VAR{keys} matches.
592 \IT{(\Goo{\MC*{ECASE}\XOR\MC*{CCASE}} \VAR{test}
593 \OPn{(\NEV{\VAR{keys}} \PROGN{\VAR{foo}})})}
595 Return the \retval{values} of the first \OPn{\VAR{foo}} one of whose \VAR{keys} is \kwd{eql}
596 \VAR{test}. Signal non-correctable/correctable \kwd{type-error} and
597 return \retval{\NIL} if no element of \VAR{keys} matches.
600 \IT{(\MC*{AND} \OPn{\VAR{form}}\DF{\T})}
602 Evaluate \VAR{form}s from left to
603 right. Immediately return \retval{\NIL} if one \VAR{form}'s value is \NIL. Return
604 \retval{values of last \VAR{form}} otherwise.
607 \IT{(\MC*{OR} \OPn{\VAR{form}}\DF{\NIL})}
609 Evaluate \VAR{form}s from left to
610 right. Immediately return \retval{primary value} of first
611 non-\NIL-evaluating form, or \retval{all values} if last \VAR{form}
612 is reached. Return \retval{\NIL} if no \VAR{form} returns \T.
615 \IT{(\SO*{PROGN} \OPn{\VAR{form}}\DF{\NIL})}
616 {\label{:progn}
617 Evaluate \VAR{form}s sequentially. Return
618 \retval{values of last \VAR{form}}.
621 \IT{(\xorGOO{\MC*{PROG}\\
622 \MC*{PROG\A}}{\}}
623 (\orGOO{%
624 \VAR{var}\\
625 (\VAR{var } \Op{\VAR{value}\DF{\NIL}})}{\}^{\!\!*}})
626 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
627 \xorGOO{\NEV{\VAR{tag}}\\\VAR{form}}{\}^{\!\!*}})}
629 Evaluate \SO{TAGBODY}-like body with \VAR{var}s locally bound (in
630 parallel or sequentially, respectively) to \VAR{value}s. Return
631 \retval{\NIL} or explicitly \retval{\MC{return}ed values}.
632 Implicitly, the whole form is a \SO{block} named \NIL.
635 \IT{\arrGOO{%
636 (\SO*{MULTIPLE-VALUE-PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\
637 (\MC*{PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\
638 (\MC*{PROG2} \VAR{ form-a} \VAR{ form-r} \OPn{\VAR{ form}})}{.}}
640 Evaluate forms in order. Return \retval{values/1st value},
641 respectively, of \VAR{form-r}.
644 \IT{(\SO*{PROGV} \VAR{symbols} \VAR{values} \PROGN{\VAR{form}})}
646 Evaluate \VAR{form}s with \VAR{symbols} dynamically bound to \VAR{values} or
647 \NIL. Return \retval{values of \VAR{form}s}.
650 \IT{(\SO*{UNWIND-PROTECT} \VAR{protected} \OPn{\VAR{cleanup}})}
652 Evaluate \VAR{protected} and then, no matter how control leaves
653 \VAR{protected}, \VAR{cleanup}s. Return \retval{values of
654 \VAR{protected}}.
657 \IT{(\MC*{DESTRUCTURING-BIND} \VAR{destruct-$\lambda$} \VAR{bar} \OPn{(\kwd{declare}
658 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
660 Evaluate \VAR{form}s with variables from tree \VAR{destruct-$\lambda$} bound to
661 corresponding elements of tree \VAR{bar}, and return \retval{their
662 values}. \VAR{destruct-$\lambda$} resembles \VAR{macro-$\lambda$}
663 (section \ref{section:Macros}), but without any \kwd{\&environment}
664 clause.
667 \IT{(\MC*{MULTIPLE-VALUE-BIND} (\OPn{\NEV{\VAR{var}}}) \VAR{values-form}
668 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{body-form}})}
670 Evaluate
671 \VAR{body-form}s with \VAR{var}s lexically bound to the return values of
672 \VAR{values-form}. Return \retval{values of \VAR{body-form}s}.
675 \IT{(\xorGOO{\SO*{LET}\\
676 \SO*{LET\A}}{\}}(%
677 \orGOO{\VAR{name}\\
678 (\VAR{name }\Op{\VAR{value}\DF{\NIL}})}{\}^{\!\!*}})
679 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
680 \PROGN{\VAR{form}})}
682 Evaluate \VAR{form}s with \VAR{name}s lexically bound (in parallel or
683 sequentially, respectively) to \VAR{value}s. Return
684 \retval{values of \VAR{form}s}.
687 \IT{(\SO*{LOCALLY} \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
688 \PROGN{\VAR{form}})}
690 Evaluate \VAR{form}s in a lexical environment with declarations
691 \VAR{decl} in effect. Return \retval{values of \VAR{form}s}.
694 \IT{(\SO*{BLOCK} \VAR{name} \PROGN{\VAR{form}})}
696 Evaluate \VAR{form}s with lexical scope and dynamic extent, and
697 return \retval{their values} unless interrupted by
698 \SO{RETURN-FROM}.
701 \IT{\arrGOO{(\SO*{RETURN-FROM } \VAR{foo } \Op{\VAR{result}\DF{\NIL}})\\
702 (\MC*{RETURN } \Op{\VAR{result}\DF{\NIL}})}{.}}
704 Have nearest enclosing \SO{block} named \VAR{foo}/named \NIL,
705 respectively, return with values of \VAR{result}.
708 \IT{(\SO*{TAGBODY} \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
710 Evaluate \VAR{form}s. \VAR{tag}s (symbols or integers) have lexical
711 scope and dynamic extent, and are targets for \SO{GO}. Return
712 \retval{\NIL}.
715 \IT{(\SO*{GO} \NEV{\VAR{tag}})}
717 Within the innermost enclosing \SO{tagbody}, jump to a tag \kwd{eql} \VAR{tag}.
720 \IT{(\SO*{CATCH} \VAR{tag} \PROGN{\VAR{form}})}
722 Evaluate \VAR{form}s and return \retval{their values} unless
723 interrupted by \SO{THROW}.
726 \IT{(\SO*{THROW} \VAR{tag} \VAR{form})}
727 {Have the nearest dynamically
728 enclosing \SO{CATCH} with a tag \FU{eq} \VAR{tag} return with the
729 values of \VAR{form}.
732 \IT{(\FU*{SLEEP} \VAR{n})}
733 {Wait \VAR{n} seconds, return \retval{\NIL}.
736 \end{LIST}
739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
740 \subsection{Iteration}
741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
743 \begin{LIST}{1cm}
745 \IT{(\xorGOO{\MC*{DO}\\
746 \MC*{DO\A}}{\}}
747 (\xorGOO{%
748 \VAR{var}\\
749 (\VAR{var } \OP{ \VAR{start } \Op{\VAR{step}}})}{\}^{\!\!*}})
750 (\VAR{stop} \PROGN{\VAR{result}})
751 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
752 \xorGOO{\NEV{\VAR{tag}}\\\VAR{form}}{\}^{\!\!*}})}
754 Evaluate \SO{TAGBODY}-like body with \VAR{var}s successively bound according
755 to the values of the corresponding \VAR{start} and \VAR{step}
756 forms. \VAR{var}s are bound in parallel/sequentially, respectively.
757 Stop iteration when \VAR{stop} is \T. Return \retval{values of
758 \OPn{\VAR{result}}}. Implicitly, the whole form is a \SO{block}
759 named \NIL.
762 \IT{(\MC*{DOTIMES} (\VAR{var} \VAR{i} \Op{\VAR{result}\DF{\NIL}})
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 integers from 0 to $i - 1$. Upon evaluation of
768 \retval{\VAR{result}}, \VAR{var} is \VAR{i}. Implicitly, the whole
769 form is a \SO{block} named \NIL.
772 \IT{(\MC*{DOLIST }(\VAR{var} \VAR{list} \Op{\VAR{result}\DF{\NIL}})
773 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
774 \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
776 Evaluate \SO{TAGBODY}-like body with \VAR{var} successively bound
777 to the elements of \VAR{list}. Upon evaluation of
778 \retval{\VAR{result}}, \VAR{var} is \NIL. Implicitly, the whole form
779 is a \SO{block} named \NIL.
783 \end{LIST}
785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
786 \subsection{Loop Facility}
787 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
790 \begin{LIST}{1cm}
792 \IT{(\MC*{LOOP} \OPn{\VAR{form}})}
794 Simple Loop. If \VAR{form}s do not contain any atomic Loop Facility
795 keywords, evaluate them forever in an implicit \SO{block} named \NIL.
798 \IT{(\MC*{LOOP} \OPn{\VAR{form}})}
800 Loop Facility. For Loop Facility keywords
801 see below and Figure \ref{loop-overview}.
804 \begin{LIST}{.5cm}
806 \IT{\LKWD*{named} \VAR{n}\DF{\NIL}}
808 Give \MC{loop}'s implicit \SO{block} a name.
811 \IT{\Goop{\LKWD*{with}
812 \xorGOO{%
813 \VAR{var-s}\\
814 (\OPn{\VAR{var-s}})}{\}}
815 \Op{\VAR{d-type}} \LKWD*{=} \VAR{foo}} \Goos{\LKWD*{and}
816 \xorGOO{%
817 \VAR{var-p}\\
818 (\OPn{\VAR{var-p}})}{\}}
819 \Op{\VAR{d-type}} \LKWD*{=} \VAR{bar}}
820 \penalty-10
821 where destructuring type specifier \VAR{d-type} has the form
822 \penalty-5
823 \GOO{\kwd{fixnum}\XOR
824 \kwd{float}\XOR
825 \T\XOR
826 \NIL\XOR
827 \GOo{%
828 \LKWD*{of-type}
829 \xorGOO{\VAR{type}\\
830 (\OPn{\VAR{type}})}{\}}}}
833 Initialize (possibly trees of) local variables \VAR{var-s}
834 sequentially and \VAR{var-p} in parallel.
837 \IT{\Goo{\LKWD*{initially}\XOR\LKWD*{finally}} \RP{\VAR{form}}}
839 Evaluate \VAR{form}s before begin, or after end, respectively, of iterations.
842 \begin{figure}%
843 \begin{center}%
844 \begin{sideways}%
846 \arraycolsep0pt
848 \text{\kwd{loop}}\text{ }
849 \Op{
850 \text{\LKWD{named} \VAR{n}\DF{\NIL}}
852 \left\{
853 \begin{array}{l}
854 \text{\LKWD{with}
855 \xorGOO{%
856 \VAR{var}\\
857 (\OPn{\VAR{var}})}{\}}
858 \Op{\VAR{d-type}} \LKWD{=} \VAR{foo }}
859 \{\text{\LKWD{and}
860 \xorGOO{%
861 \VAR{var}\\
862 (\OPn{\VAR{var}})}{\}}
863 \Op{\VAR{d-type}} \LKWD{=}
864 \VAR{bar}}\}^{*} \\ \\[-2.4ex]
865 \left.\!
866 \begin{array}{l}
867 \text{\LKWD{for}} \\
868 \text{\LKWD{as}}
869 \end{array}\right\}
870 \boxed{
871 \text{\xorGOO{%
872 \VAR{var}\\
873 (\OPn{\VAR{var}})}{\}}}%
874 \Op{\VAR{d-type}}
875 \left\{
876 \begin{array}{l}
877 \left.\!
878 \begin{array}{l}
879 \OP{
880 \left\{
881 \begin{array}{l}
882 \text{\LKWD{upfrom}}\\
883 \text{\LKWD{from}}
884 \end{array}
885 \right\}
886 \text{\VAR{start}\DF{\LIT{0}}}
887 }\text{ }
888 \OP{
889 \left\{
890 \begin{array}{l}
891 \text{\LKWD{upto}}\\
892 \text{\LKWD{to}}\\
893 \text{\LKWD{below}}
894 \end{array}
895 \right\}
896 \text{\VAR{form}}
898 \text{\LKWD{from} \VAR{start}}
899 \left\{
900 \begin{array}{l}
901 \text{\LKWD{downto}}\\
902 \text{\LKWD{above}}
903 \end{array}
904 \right\}
905 \text{\VAR{form }}\\
906 \text{\LKWD{downfrom} \VAR{start}}\text{ }
907 \OP{
908 \left\{
909 \begin{array}{l}
910 \text{\LKWD{downto}}\\
911 \text{\LKWD{to}}\\
912 \text{\LKWD{above}}
913 \end{array}
914 \right\}
915 \text{\VAR{form}}
917 \end{array}
918 \right\}
919 \Op{
920 \text{\LKWD{by} \VAR{step}\DF{\LIT{1}}}
922 \left.\!
923 \begin{array}{l}
924 \text{\LKWD{in}} \\
925 \text{\LKWD{on}}
926 \end{array}
927 \right\}
928 \text{\VAR{list}}\text{ }
929 \Op{
930 \text{\LKWD{by} \VAR{function}\DF{\kwd{cdr}}}
932 \text{\LKWD{=} \VAR{foo }}
933 \Op{
934 \text{\LKWD{then} \VAR{bar}\DF{\VAR{foo}}}
936 \text{\LKWD{across} \VAR{vector}}\\
937 \text{\LKWD{being}}
938 \left\{
939 \begin{array}{l}
940 \text{\LKWD{the}}\\
941 \text{\LKWD{each}}
942 \end{array}
943 \right\}%
944 \left\{
945 \begin{array}{{l}}
946 \left.\!
947 \begin{array}{l}
948 \left.\!
949 \begin{array}{l}
950 \text{\LKWD{hash-key}}\\
951 \text{\LKWD{hash-keys}}
952 \end{array}
953 \right\}%
954 \left\{
955 \begin{array}{l}
956 \text{\LKWD{of}}\\
957 \text{\LKWD{in}}
958 \end{array}
959 \right\}
960 \text{\VAR{hash }}
961 \Op{
962 \text{\LKWD{using} (\LKWD{hash-value} \VAR{v})}%
964 \left.\!
965 \begin{array}{l}
966 \text{\LKWD{hash-value}}\\
967 \text{\LKWD{hash-values}}
968 \end{array}
969 \right\}%
970 \left\{
971 \begin{array}{l}
972 \text{\LKWD{of}}\\
973 \text{\LKWD{in}}
974 \end{array}
975 \right\}
976 \text{\VAR{hash }}
977 \Op{
978 \text{\LKWD{using} (\LKWD{hash-key} \VAR{k})}%
980 \end{array}
981 \right.\\
982 \left.\!
983 \begin{array}{l}
984 \text{\LKWD{symbol\Op{s}}}\\
985 \text{\LKWD{present-symbol\Op{s}}}\\
986 \text{\LKWD{external-symbol\Op{s}}}
987 \end{array}
988 \right\}%
989 \OP{
990 \left\{
991 \begin{array}{l}
992 \text{\LKWD{of}}\\
993 \text{\LKWD{in}}
994 \end{array}
995 \right\} \text{\VAR{package}\DF{\V{\A package\A}}}%
997 \end{array}\!\!%
998 \right.%
999 \end{array}%
1000 \right\}_{\displaystyle{\mathbb{F}_0}}
1001 }%boxed
1002 \left\{
1003 \text{\LKWD{and} }\boxed{\mathbb{F}_i\!}
1004 \right\}^{\!*}\\
1005 \\[-2.4ex]
1006 \left.\!%
1007 \begin{array}{l}
1008 \text{\LKWD{initially}} \\
1009 \text{\LKWD{finally}}
1010 \end{array}
1011 \right\}
1012 \text{\VAR{form}}^{+} \\
1014 \end{array}
1015 \right\}^{\!\!\displaystyle{*}}
1016 %Bottleneck
1017 \left\{
1018 \begin{array}{l}
1019 \text{\LKWD{repeat} \VAR{num}}\\
1020 \left.\!
1021 \begin{array}{l}
1022 \text{\LKWD{while}}\\
1023 \text{\LKWD{until}}\\
1024 \text{\LKWD{always}}\\
1025 \text{\LKWD{never}}\\
1026 \text{\LKWD{thereis}}
1027 \end{array}
1028 \right\}
1029 \text{\VAR{test}}\\
1030 \boxed{
1031 \left.\!
1032 \begin{array}{l}
1033 \left.\!
1034 \begin{array}{l}
1035 \text{\LKWD{do}}\\
1036 \text{\LKWD{doing}}
1037 \end{array}
1038 \right\}
1039 \text{\VAR{form}}^{+}\\
1040 \text{\LKWD{return}}
1041 \left\{
1042 \begin{array}{l}
1043 \text{\VAR{form}}\\
1044 \text{\LKWD{it}}
1045 \end{array}
1046 \right.\\
1047 \left.\!
1048 \begin{array}{l}
1049 \text{\LKWD{collect\Op{ing}}}\\
1050 \text{\LKWD{append\Op{ing}}}\\
1051 \text{\LKWD{nconc\Op{ing}}}
1052 \end{array}
1053 \right\}
1054 \left\{
1055 \begin{array}{l}
1056 \text{\VAR{form}}\\
1057 \text{\LKWD{it}}
1058 \end{array}
1059 \right\} \Op{\text{\LKWD{into }\VAR{list}}}\\
1060 \left.\!
1061 \begin{array}{l}
1062 \text{\LKWD{count\Op{ing}}}\\
1063 \text{\LKWD{sum\Op{ming}}}\\
1064 \text{\LKWD{maximize}}\\
1065 \text{\LKWD{maximizing}}\\
1066 \text{\LKWD{minimize}}\\
1067 \text{\LKWD{minimizing}}
1068 \end{array}
1069 \right\}
1070 \left\{
1071 \begin{array}{l}
1072 \text{\VAR{form}}\\
1073 \text{\LKWD{it}}
1074 \end{array}
1075 \right\}
1076 \Op{\text{\LKWD{into }\VAR{num}}}\text{ }
1077 \Op{\text{\VAR{type}}}\\
1078 \left.\!
1079 \begin{array}{l}
1080 \text{\LKWD{if}}\\
1081 \text{\LKWD{when}}\\
1082 \text{\LKWD{unless}}
1083 \end{array}
1084 \right\}%
1085 \text{\VAR{test }}
1086 \boxed{\mathbb{C}_i\!}\{\text{\LKWD{and}}\,
1087 \boxed{\mathbb{C}_j\!}\}^{*}\Op{\text{\LKWD{else}}\,
1088 \boxed{\mathbb{C}_k\!}\{\text{\LKWD{and}}\,
1089 \boxed{\mathbb{C}_l\!}\}^{*}}
1090 \Op{\text{\LKWD{end}}}\!\!\!\!\!\!
1091 \end{array}
1092 \right._{\!\!\!\!\displaystyle{\mathbb{C}_0}}
1093 }%boxed
1095 \\[-2.4ex]
1096 \left.\!
1097 \begin{array}{l}
1098 \text{\LKWD{initially}} \\
1099 \text{\LKWD{finally}}
1100 \end{array}
1101 \right\}
1102 \text{\VAR{form}}^{+}
1103 \end{array}
1104 \right\}^{\displaystyle{\!\!*}}
1106 \!)%
1107 \end{sideways}%
1108 \end{center}%
1109 \vspace{-3em}
1110 \raisebox{0em}[0em][0em]{\parbox[b]{4cm}{\caption{\protect\raggedright Loop Facility, Overview.\label{loop-overview}}}}
1111 \end{figure}
1113 \IT{\GOop{\Goo{\LKWD*{for}\XOR\LKWD*{as}}
1114 \xorGOO{%
1115 \VAR{var-s}\\
1116 (\OPn{\VAR{var-s}})}{\}}
1117 \Op{\VAR{d-type}}}
1118 \GOos{\LKWD*{and}
1119 \xorGOO{%
1120 \VAR{var-p}\\
1121 (\OPn{\VAR{var-p}})}{\}}
1122 \Op{\VAR{d-type}}}}
1124 Begin of iteration control clauses. Initialize and step (possibly
1125 trees of) local variables \VAR{var-s} sequentially and \VAR{var-p}
1126 in parallel. Destructuring type specifier \VAR{d-type} as with \LKWD{with}.
1129 \begin{LIST}{.5cm}
1131 \IT{\Goo{\LKWD*{upfrom}\XOR\LKWD*{from}\XOR\LKWD*{downfrom}}
1132 \VAR{start}}
1134 Start stepping with \VAR{start}
1137 \IT{\Goo{\LKWD*{upto}\XOR\LKWD*{downto}\XOR\LKWD*{to}\XOR\LKWD*{below}\XOR\LKWD*{above}}
1138 \VAR{form}}
1140 Specify \VAR{form} as the end value for stepping.
1143 \IT{\Goo{\LKWD*{in}\XOR\LKWD*{on}} \VAR{list}}
1145 Bind \VAR{var} to successive elements/tails, respectively, of \VAR{list}.
1148 \IT{\LKWD*{by} \Goo{\VAR{step}\DF{\LIT{1}}\XOR\VAR{function}\DF{\FU{cdr}}}}
1150 Specify the (positive) decrement or increment or the
1151 \VAR{function} of one argument returning the next part of the list.
1154 \IT{\LKWD*{=} \VAR{foo} \Op{\LKWD*{then}
1155 \VAR{bar}\DF{\VAR{foo}}}}
1157 Bind \VAR{var} in the first iteration to \VAR{foo} and later to \VAR{bar}.
1160 \IT{\LKWD*{across} \VAR{vector}}
1162 Bind \VAR{var} to successive elements of \VAR{vector}.
1165 \IT{\LKWD*{being} \Goo{\LKWD*{the}\XOR\LKWD*{each}}}
1167 Iterate over a hash table or a package.
1170 \begin{LIST}{.5cm}
1172 \IT{\Goo{\LKWD*{hash-key}\XOR\LKWD*{hash-keys}} \Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table}
1173 \Op{\LKWD*{using} (\LKWD*{hash-value} \VAR{value})}}
1175 Bind \VAR{var} successively to the keys of \VAR{hash-table}; bind \VAR{value} to corresponding values.
1178 \IT{\Goo{\LKWD*{hash-value}\XOR\LKWD*{hash-values}} \Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table}
1179 \Op{\LKWD*{using} (\LKWD*{hash-key} \VAR{key})}}
1181 Bind \VAR{var} successively to the values of \VAR{hash-table}; bind \VAR{key} to corresponding keys.
1184 \IT{\Goo{\LKWD*{symbol}\XOR\LKWD*{symbols}\XOR\LKWD*{present-symbol}\XOR\LKWD*{present-symbols}\XOR\LKWD*{external-symbol}\XOR\LKWD*{external-symbols}}
1185 \Op{\Goo{\LKWD*{of}\XOR\LKWD*{in}}
1186 \VAR{package}\DF{\V{\A package\A}}}}
1188 Bind \VAR{var} successively to the accessible symbols, or the present
1189 symbols, or the external symbols respectively, of
1190 \VAR{package}.
1193 \end{LIST}
1194 \end{LIST}
1196 \IT{\Goo{\LKWD*{do}\XOR\LKWD*{doing}} \RP{\VAR{form}}}
1198 Evaluate \VAR{form}s in every iteration.
1201 \IT{\LKWD*{it}}
1203 Value of \VAR{test} form of an enclosing \LKWD{if},
1204 \LKWD{when}, or \LKWD{unless} clause.
1207 \IT{\LKWD*{return} \Goo{\VAR{form}\XOR\LKWD*{it}}}
1209 Return immediately, skipping any \LKWD{finally} parts, with values of \VAR{form} or \LKWD{it}.
1212 \IT{\Goo{\LKWD*{collect}\XOR\LKWD*{collecting}}
1213 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into} \VAR{list}}}
1215 Collect values of \VAR{form} or \LKWD{it} into \VAR{list}. If no
1216 \VAR{list} is given, collect into an anonymous list which is
1217 returned after termination.
1220 \IT{\Goo{\LKWD*{append}\XOR\LKWD*{appending}\XOR\LKWD*{nconc}\XOR\LKWD*{nconcing}}
1221 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1222 \VAR{list}}}
1224 Concatenate values of \VAR{form} or \LKWD{it}, which should be
1225 lists, into \VAR{list} by the means of \FU{append} or \FU{nconc},
1226 respectively. If no \VAR{list} is given, collect into an
1227 anonymous list which is returned after termination.
1230 \IT{\Goo{\LKWD*{count}\XOR\LKWD*{counting}}
1231 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1232 \VAR{n}} \Op{\VAR{type}}}
1234 Count the number of times the value of \VAR{form} or of \LKWD{it} is \T.
1235 If no \VAR{n} is given, count into an anonymous variable
1236 which is returned after termination.
1239 \IT{\Goo{\LKWD*{sum}\XOR\LKWD*{summing}}
1240 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1241 \VAR{sum}} \Op{\VAR{type}}}
1243 Calculate the sum of the primary values of \VAR{form} or of \LKWD{it}.
1244 If no \VAR{sum} is given, sum into an anonymous variable
1245 which is returned after termination.
1248 \IT{\Goo{\LKWD*{maximize}\XOR\LKWD*{maximizing}\XOR
1249 \LKWD*{minimize}\XOR
1250 \LKWD*{minimizing}} \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1251 \VAR{max-min}} \Op{\VAR{type}}}
1253 Determine the maximum or minimum, respectively, of the primary values of
1254 \VAR{form} or of \LKWD{it}.
1255 If no \VAR{max-min} is given, use an anonymous variable
1256 which is returned after termination.
1259 \IT{\Goo{\LKWD*{if}\XOR\LKWD*{when}\XOR\LKWD*{unless}} \VAR{ test}
1260 \VAR{i-form} \Goos{\LKWD*{and}
1261 \VAR{j-form}} \Op{\LKWD*{else} \VAR{k-form} \Goos{\LKWD*{and}
1262 \VAR{l-form}}} \Op{\LKWD*{end}}}
1264 If \VAR{test} returns \T, \T, or \NIL, respectively, evaluate
1265 \VAR{i-form} and \VAR{j-form}s; otherwise, evaluate \VAR{k-form}
1266 and \VAR{l-form}s. Inside \VAR{i-form} and \VAR{k-form}, the value
1267 of \VAR{test} is accessible by \LKWD*{it}.
1270 \IT{\LKWD*{repeat} \VAR{num}}
1272 Terminate \MC{loop} after \VAR{num} iterations; \VAR{num} is evaluated once.
1275 \IT{\Goo{\LKWD*{while}\XOR\LKWD*{until}} \VAR{test}}
1277 Continue iteration until \VAR{test} returns \NIL\ or \T, respectively.
1280 \IT{\Goo{\LKWD*{always}\XOR\LKWD*{never}} \VAR{test}}
1282 Terminate \MC{loop} returning \NIL\ and skipping any
1283 \LKWD{finally} parts as soon as \VAR{test} is \NIL\ or \T,
1284 respectively. Otherwise continue \MC{loop} with its default return
1285 value set to \T.
1288 \IT{\LKWD*{thereis} \VAR{test}}
1290 Terminate \MC{loop} when \VAR{test} is \T\ and return value of
1291 \VAR{test}, skipping any \LKWD{finally} parts. Otherwise continue
1292 \MC{loop} with its default return value set to \NIL.
1295 \IT{\LKWD*{loop-finish}}
1297 Terminate \MC{loop} immediately executing any \LKWD{finally}
1298 clauses and returning any accumulated results.
1300 \end{LIST}
1301 \end{LIST}
1306 % LocalWords: pt
1308 %%% Local Variables:
1309 %%% mode: latex
1310 %%% TeX-master: "clqr"
1311 %%% End: