put a few fixme tags regarding implicit blocks
[clqr.git] / clqr-control-structure.tex
blobc89a7a5ea73b8382c1369670a366fe3e96fc728e
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}})}
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}\\%FIXME:BLOCK
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.
222 \IT{(\xorGOO{\SO*{FLET}\\
223 \SO*{LABELS}}{\}} %FIXME:BLOCK
224 (\OPn{(\VAR{foo}
225 (\OPn{\VAR{ord-$\lambda$}})
226 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{local-decl}}})}%
227 \Op{\NEV{\VAR{doc}}}
228 \PROGN{\VAR{local-form}})}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
229 \PROGN{\VAR{form}})}
231 Evaluate \VAR{form}s with
232 locally defined functions \VAR{foo}. Only for \SO{LABELS},
233 \VAR{foo}s are visible inside \VAR{local-forms}. Return
234 \retval{values of \VAR{form}s}.
237 \IT{(\SO*{FUNCTION} \xorGOO{%
238 \VAR{foo}\\
239 (\MC{lambda } \OPn{\VAR{form}})}{\}})}
241 Return lexically innermost \retval{function} named \VAR{foo} or a
242 lexical closure of the \retval{\MC{lambda} expression}.
245 \IT{(\FU*{APPLY} \VAR{function} \RP{\VAR{arg}})}
247 Return \retval{values of \VAR{function}} called on
248 \VAR{arg}s. Last \VAR{arg} must be a list.
251 \IT{(\FU*{FUNCALL} \VAR{function} \OPn{arg})}
253 Return \retval{values of \VAR{function}} called with \VAR{arg}s.
256 \IT{(\SO*{MULTIPLE-VALUE-CALL} \VAR{foo} \OPn{\VAR{form}})}
257 {Call function
258 \VAR{foo} with all the values of each \VAR{form} as its arguments. Return
259 \retval{values returned by \VAR{foo}}.
262 \IT{(\FU*{VALUES-LIST} \VAR{list})}
264 Return \retval{elements of \VAR{list}}.
267 \IT{(\FU*{VALUES} \OPn{\VAR{foo}})}
269 Return as multiple values the \retval{primary values} of the
270 \VAR{foo}s. \kwd{setf}able.
273 \IT{(\FU*{MULTIPLE-VALUE-LIST} \VAR{form})}
275 Return in a \retval{list} values of \VAR{form}.
278 \IT{(\FU*{NTH-VALUE} \VAR{n} \VAR{form})}
280 Zero-indexed \retval{\VAR{n}th return value} of \VAR{form}.
283 \IT{(\FU*{COMPLEMENT} \VAR{function})}
285 Return \retval{new function} with same arguments and same side effects
286 as \VAR{function}, but with complementary truth value.
289 \IT{(\FU*{CONSTANTLY} \VAR{foo})}
291 Return \retval{function} of any number of arguments returning \VAR{foo}.
294 \IT{(\FU*{IDENTITY} \VAR{foo})}
296 Return \retval{\VAR{foo}}.
299 \IT{(\FU*{FUNCTION-LAMBDA-EXPRESSION} \VAR{function})}
301 If available, return \retval{lambda expression} of \VAR{function},
302 \retvalii{\NIL} if \VAR{function} was defined in an environment
303 without bindings, and \retvaliii{name} of \VAR{function}.
306 \IT{(\FU*{FDEFINITION} \VAR{foo})}
308 \retval{Definition} of function \VAR{foo}. \kwd{setf}able.
311 \IT{(\FU*{FMAKUNBOUND} \VAR{foo})}
313 Remove global function or macro definition \retval{\VAR{foo}}.
316 \IT{\arrGOO{\CNS*{CALL-ARGUMENTS-LIMIT}\\
317 \CNS*{LAMBDA-PARAMETERS-LIMIT}}{.}}
319 Upper bound of the number of function arguments or lambda list
320 parameters, respectively; $\geq50$.
323 \IT{\CNS*{MULTIPLE-VALUES-LIMIT}}
325 Upper bound of the number of values a function can return; $\geq20$.
328 \end{LIST}
331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332 \subsection{Macros}
333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
334 \label{section:Macros}
336 \begin{flushleft}
337 Below, macro lambda list (\OPn{\VAR{macro-$\lambda$}}) has the form of
338 either
339 \penalty-5
340 (\Op{\kwd*{\&whole} \VAR{var}}
341 \penalty-5
342 \Op{\VAR{E}}
343 \penalty-5
344 \xorGOO{%
345 \VAR{var}\\
346 (\OPn{\VAR{macro-$\lambda$}})}{\}^{\!\!*}}
347 \penalty-5
348 \Op{\VAR{E}}
349 \penalty-5
350 \Op{\kwd*{\&optional}
351 \xorGOO{%
352 \VAR{var}\\
353 (\xorGOO{%
354 \VAR{var}\\
355 (\OPn{\VAR{macro-$\lambda$}})}{\}}\text{ }
356 \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}}
357 \penalty-5
358 \Op{\VAR{E}}
359 \penalty-5
360 \Op{%
361 \xorGOO{%
362 \kwd*{\&rest}\\
363 \kwd*{\&body}}{\}}
364 \xorGOO{%
365 \VAR{var}\\
366 (\OPn{\VAR{macro-$\lambda$}})}{\}}}
367 \penalty-5
368 \Op{\VAR{E}}
369 \penalty-5
370 \OP{\kwd*{\&key}
371 \xorGOO{%
372 \VAR{var}\\
373 (\xorGOO{%
374 \VAR{var}\\
375 (\kwd{:}\VAR{key } \xorGOO{%
376 \VAR{var}\\
377 (\OPn{\VAR{macro-$\lambda$}})}{\}})}{\}}
378 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
379 \Op{\VAR{E}}
380 \Op{\kwd*{\&allow-other-keys}}}
381 \penalty-5
382 \Op{\kwd*{\&aux}
383 \xorGOO{%
384 \VAR{var}\\
385 (\VAR{var } \Op{\VAR{init}\DF{\NIL}})}{\}^{\!\!*}}}
386 \penalty-5
387 \Op{\VAR{E}})
390 \penalty-5
391 (\Op{\kwd*{\&whole}
392 \VAR{var}}
393 \penalty-5
394 \Op{\VAR{E}}
395 \penalty-5
396 \xorGOO{%
397 \VAR{var}\\
398 (\OPn{\VAR{macro-$\lambda$}})}{\}^{\!\!*}}
399 \penalty-5
400 \Op{\VAR{E}}
401 \penalty-5
402 \Op{\kwd*{\&optional}
403 \xorGOO{%
404 \VAR{var}\\
405 (\xorGOO{%
406 \VAR{var}\\
407 (\OPn{\VAR{macro-$\lambda$}})}{\}}\text{ }
408 \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}^{\!\!*}}}
409 \penalty-5
410 \Op{\VAR{E}}
411 \kwd{.}
412 \VAR{var}).
413 \penalty-5
414 One toplevel \Op{\VAR{E}} may be replaced by \kwd*{\&environment}
415 \VAR{var}. \VAR{supplied-p} is \T\ if there is a corresponding
416 argument.
417 \end{flushleft}
419 \begin{LIST}{1cm}
421 \IT{(\xorGOO{\MC*{DEFMACRO}\\%FIXME:BLOCK
422 \FU*{DEFINE-COMPILER-MACRO}}{\}}
423 \VAR{foo} (\OPn{\VAR{macro-$\lambda$}})
424 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
425 \OPn{\VAR{form}})}
427 Define macro \retval{\VAR{foo}} which on evaluation as (\VAR{foo}
428 \VAR{tree}) applies expanded \VAR{form}s to arguments from
429 \VAR{tree} which corresponds to \VAR{tree}-shaped
430 \VAR{macro-$\lambda$}s.
433 \IT{(\MC*{DEFINE-SYMBOL-MACRO} \VAR{foo} \VAR{form})}
435 Define symbol macro \retval{\VAR{foo}} which on evaluation evaluates
436 expanded \VAR{form}.
439 \IT{(\SO*{MACROLET} (\OPn{(\VAR{foo} (\OPn{\VAR{macro-$\lambda$}}) %FIXME:BLOCK
440 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{local-decl}}})}
441 \Op{\NEV{\VAR{doc}}} \PROGN{\VAR{macro-form}})}) \OPn{(\kwd{declare}
442 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
444 Evaluate \retval{\VAR{form}s} with locally defined mutually
445 invisible macros \VAR{foo}.
448 \IT{(\SO*{SYMBOL-MACROLET} (\OPn{(\VAR{foo}
449 \VAR{expansion-form})}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
450 \PROGN{\VAR{form}})}
452 Evaluate \retval{\VAR{form}s} with locally defined symbol macros
453 \VAR{foo}.
456 \IT{(\MC*{DEFSETF} \NEV{\VAR{function}} \xorGOO{% %FIXME:BLOCK
457 \NEV{\VAR{updater}} \text{ } \Op{\NEV{\VAR{doc}}}\\
458 (\OPn{\VAR{setf-$\lambda$}}) \text{ } (\OPn{\VAR{s-var}}) \text{ }
459 \OPn{(\kwd{declare } \OPn{\NEV{\VAR{decl}}})}\text{ }
460 \Op{\NEV{\VAR{doc}}} \text{ } \OPn{form}}{\}})
461 \penalty-5
462 where defsetf lambda list (\OPn{\VAR{setf-$\lambda$}}) has the form
463 \penalty-5
464 (\OPn{\VAR{var}}
465 \OP{\kwd*{\&optional} \xorGOO{%
466 \VAR{var}\\
467 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ } \Op{\VAR{supplied-p}}})}{\}}}
468 \penalty-5
469 \Op{\kwd*{\&rest} \VAR{var}}
470 \penalty-5
471 \OP{\kwd*{\&key} \xorGOO{%
472 \VAR{var}\\
473 (\xorGOO{%
474 \VAR{var}\\
475 (\kwd{:}\VAR{key } \VAR{var})}{\}}
476 \text{ }\OP{\VAR{init}\DF{\NIL}\text{ }\Op{\VAR{supplied-p}}})}{\}^{\!\!*}}
477 \penalty-5
478 \Op{\kwd*{\&allow-other-keys}}}
479 \penalty-5
480 \OP{\kwd*{\&environment} \VAR{var}}%
484 Specify how to \kwd{setf} a place accessed by
485 \retval{\VAR{function}}.
486 Short form: (\kwd{setf} (\VAR{function} \OPn{\VAR{arg}}) \VAR{value-form}) is
487 replaced by (\VAR{updater} \OPn{\VAR{arg}} \VAR{value-form}).
488 Long form: on invocation of (\kwd{setf} (\VAR{function}
489 \OPn{\VAR{arg}}) \VAR{value-form}), \OPn{\VAR{form}} must expand
490 into code setting the place accessed where \VAR{setf-$\lambda$}
491 and \OPn{\VAR{s-var}} describe the arguments of \VAR{function} and
492 the value(s) to be stored, respectively. \VAR{form}s must provide for returning
493 the value(s) of \OPn{\VAR{s-var}}.
496 \IT{(\MC*{DEFINE-SETF-EXPANDER} \VAR{function}
497 (\OPn{\VAR{macro-$\lambda$}}) %FIXME:BLOCK
498 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \Op{\NEV{\VAR{doc}}}
499 \PROGN{\VAR{form}})}
501 Specify how to \kwd{setf} a place accessed by
502 \retval{\VAR{function}}. On invocation of (\kwd{setf} (\VAR{function}
503 \OPn{\VAR{arg}}) \VAR{value-form}), \OPn{\VAR{form}} must expand
504 into code returning \VAR{arg-vars}, \VAR{args}, \VAR{newval-vars},
505 \VAR{set-form}, and \VAR{get-form} as described with
506 \FU{GET-SETF-EXPANSION}. In the expansion, the elements of macro
507 lambda list \OPn{\VAR{macro-$\lambda$}} are bound to corresponding
508 \VAR{arg}s.
511 \IT{(\FU*{GET-SETF-EXPANSION} \VAR{place} \Op{\VAR{environment}})}
513 Return lists of temporary variables \retval{\VAR{arg-vars}} and of
514 corresponding \retvalii{\VAR{args}} as given with \VAR{place},
515 list \retvaliii{\VAR{\VAR{newval-vars}}} with temporary variables
516 corresponding to the new values, and \retvaln{4}{\VAR{set-form}}
517 and \retvaln{5}{get-form} specifying in terms of \VAR{arg-vars}
518 and \VAR{newval-vars} how to \kwd{setf} and how to read
519 \VAR{place}.
522 \IT{(\MC*{DEFINE-MODIFY-MACRO} \VAR{foo}
523 (\OP{\kwd*{\&optional} \xorGOO{%
524 \VAR{var}\\
525 (\VAR{var } \OP{\VAR{init}\DF{\NIL}\text{ }
526 \Op{\VAR{supplied-p}}})}{\}}}
527 \Op{\kwd*{\&rest} \VAR{var}})
528 \VAR{function} \Op{\NEV{\VAR{doc}}})}
530 Define macro \retval{\VAR{foo}} able to modify a place. On
531 invocation of (\VAR{foo} \VAR{place} \OPn{\VAR{arg}}), the value of
532 \VAR{function} applied to \VAR{place} and \VAR{arg}s will be stored into
533 \VAR{place} and returned.
536 \IT{\CNS*{LAMBDA-LIST-KEYWORDS}}
537 {List of macro lambda list keywords.
540 \end{LIST}
543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
544 \subsection{Control Flow}
545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
546 \begin{LIST}{1cm}
548 \IT{(\SO*{IF} \VAR{test} \VAR{then} \Op{\VAR{else}\DF{\NIL}})}
549 {Return value of
550 \retval{\VAR{then}} if \VAR{test} returns \T; return value of
551 \retval{\VAR{else}} otherwise.
554 \IT{(\MC*{COND} \OPn{(\VAR{test} \PROGN{\VAR{then}}\DF{\VAR{test}})})}
556 Return the \retval{values} of the first
557 \OPn{\VAR{then}} whose \VAR{test} returns \T; return
558 \retval{\NIL} if all \VAR{test}s returns \NIL.
561 \IT{(\xorGOO{\MC*{WHEN}\\
562 \MC*{UNLESS}}{\}} \VAR{test}
563 \PROGN{\VAR{foo}}\DF{\NIL})}
565 Evaluate \VAR{foo}s and return \retval{their values} if \VAR{test}
566 returns \T\ or \NIL, respectively. Return \retval{\NIL} otherwise.
569 \IT{(\MC*{CASE} \VAR{test} \OPn{(\NEV{\VAR{keys}} \PROGN{\VAR{foo}})}
570 \Op{(\Goo{\T\XOR\kwd*{OTHERWISE}} \PROGN{\VAR{bar}})\DF{\NIL}})}
572 Return the \retval{values} of the first \OPn{\VAR{foo}} one of whose \VAR{keys} is
573 \kwd{eql} \VAR{test}.
574 Return \retval{values of \VAR{bar}s} if no element of \VAR{keys} matches.
577 \IT{(\Goo{\MC*{CCASE}\XOR\MC*{ECASE}} \VAR{test}
578 \OPn{(\NEV{\VAR{keys}} \PROGN{\VAR{foo}})})}
580 Return the \retval{values} of the first \OPn{\VAR{foo}} one of whose \VAR{keys} is \kwd{eql}
581 \VAR{test}. Return \retval{\NIL} and signal correctable
582 error/non-correctable \kwd{type-error}, respectively, if no element of
583 \VAR{keys} matches.
586 \IT{(\MC*{AND} \OPn{\VAR{form}}\DF{\T})}
588 Evaluate \VAR{form}s from left to
589 right. Immediately return \retval{\NIL} if one \VAR{form}'s value is \NIL. Return
590 \retval{values of last \VAR{form}} otherwise.
593 \IT{(\MC*{OR} \OPn{\VAR{form}}\DF{\NIL})}
595 Evaluate \VAR{form}s from left to
596 right. Immediately return \retval{primary value} of first
597 non-\NIL-evaluating form, or \retval{all values} if last \VAR{form}
598 is reached. Return \retval{\NIL} if no \VAR{form} returns \T.
601 \IT{(\SO*{PROGN} \OPn{\VAR{form}}\DF{\NIL})}
602 {\label{:progn}
603 Evaluate \VAR{form}s sequentially. Return
604 \retval{values of last \VAR{form}}.
607 \IT{(\xorGOO{\MC*{PROG}\\%FIXME:BLOCK
608 \MC*{PROG\A}}{\}}
609 (\orGOO{%
610 \VAR{var}\\
611 (\VAR{var } \Op{ \VAR{value}})}{\}^{\!\!*}})
612 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
613 \xorGOO{\NEV{\VAR{tag}}\\\VAR{form}}{\}^{\!\!*}})}
615 Evaluate \SO{TAGBODY}-like body with \VAR{var}s locally bound (in parallel or sequentially, respectively) to
616 \VAR{value}s. Return \retval{\NIL} or explicitly
617 \retval{\MC{return}ed value}.
620 \IT{\arrGOO{%
621 (\SO*{MULTIPLE-VALUE-PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\
622 (\MC*{PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\
623 (\MC*{PROG2} \VAR{ form-a} \VAR{ form-r} \OPn{\VAR{ form}})}{.}}
625 Evaluate forms in order. Return \retval{values/1st value},
626 respectively, of \VAR{form-r}.
629 \IT{(\SO*{PROGV} \VAR{symbols} \VAR{values} \PROGN{\VAR{form}})}
631 Evaluate \VAR{form}s with \VAR{symbols} dynamically bound to \VAR{values} or
632 \NIL. Return \retval{values of \VAR{form}s}.
635 \IT{(\SO*{UNWIND-PROTECT} \VAR{protected} \OPn{\VAR{cleanup}})}
637 Evaluate \VAR{protected} and then, no matter how control leaves
638 \VAR{protected}, \VAR{cleanup}s. Return \retval{values of
639 \VAR{protected}}.
642 \IT{(\MC*{DESTRUCTURING-BIND} \VAR{foo} \VAR{bar} \OPn{(\kwd{declare}
643 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
645 Evaluate \VAR{form}s and return \retval{their values},
646 with variables from tree \VAR{foo} bound to corresponding elements
647 of tree \VAR{bar}.
650 \IT{(\MC*{MULTIPLE-VALUE-BIND} (\OPn{\NEV{\VAR{var}}}) \VAR{values-form}
651 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{body-form}})}
653 Evaluate
654 \VAR{body-form}s with \VAR{var}s bound to the return values of
655 \VAR{values-form}. Return \retval{values of \VAR{body-form}s}.
658 \IT{(\xorGOO{\SO*{LET}\\
659 \SO*{LET\A}}{\}}(%
660 \orGOO{\VAR{name}\\
661 (\VAR{name }\Op{\VAR{value}\DF{\NIL}})}{\}^{\!\!*}})
662 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
663 \PROGN{\VAR{form}})}
665 Evaluate \VAR{form}s with \VAR{name}s bound (in parallel or
666 sequentially, respectively) to \VAR{value}s. Return
667 \retval{values of \VAR{form}s}.
670 \IT{(\SO*{LOCALLY} \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
671 \PROGN{\VAR{form}})}
673 Evaluate \VAR{form}s with declarations \VAR{decl} in
674 effect. Return \retval{values of \VAR{form}s}.
677 \IT{\arrGOO{(\SO*{RETURN-FROM } \VAR{foo } \Op{\VAR{result}\DF{\NIL}})\\
678 (\MC*{RETURN } \Op{\VAR{result}\DF{\NIL}})}{.}}
680 Have nearest enclosing \SO{block} named \VAR{foo}/named \NIL,
681 repectively, return with values of \VAR{result}.
684 \IT{(\SO*{BLOCK} \VAR{name} \PROGN{\VAR{form}})}
686 Evaluate \VAR{form}s and return \retval{their values} unless
687 interrupted by \SO{RETURN-FROM}.
690 \IT{(\SO*{TAGBODY} \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
692 Evaluate \VAR{form}s. \VAR{tag}s (symbols or integers) are targets
693 for \SO{GO}. Return \retval{\NIL}.
696 \IT{(\SO*{GO} \VAR{tag})}
697 {Jump within a \SO{tagbody} to nearest
698 lexically enclosing \kwd{eql} \VAR{tag}.
701 \IT{(\SO*{CATCH} \VAR{tag} \PROGN{\VAR{form}})}
703 Evaluate \VAR{form}s and return \retval{their values} unless
704 interrupted by \SO{THROW}.
707 \IT{(\SO*{THROW} \VAR{tag} \VAR{form})}
708 {Have the nearest dynamically
709 enclosing \SO{CATCH} with a tag \FU{eq} \VAR{tag} return with the
710 values of \VAR{form}.
713 \IT{(\FU*{SLEEP} \VAR{n})}
714 {Wait \VAR{n} seconds, return \retval{\NIL}.
717 \end{LIST}
720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
721 \subsection{Iteration}
722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
724 \begin{LIST}{1cm}
726 \IT{(\xorGOO{\MC*{DO}\\%FIXME:BLOCK
727 \MC*{DO\A}}{\}}
728 (\orGOO{%
729 \VAR{var}\\
730 (\VAR{var } \OP{ \VAR{start } \Op{\VAR{step}}})}{\}^{\!\!*}})
731 (\VAR{stop} \PROGN{\VAR{result}})
732 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
733 \xorGOO{\NEV{\VAR{tag}}\\\VAR{form}}{\}^{\!\!*}})}
735 Evaluate \SO{TAGBODY}-like body with \VAR{var}s successively bound according
736 to the values of the corresponding \VAR{start} and \VAR{step}
737 forms. \VAR{var}s are bound in parallel/sequentially, respectively.
738 Stop iteration when \VAR{stop} is \T. Return \retval{values of
739 \OPn{\VAR{result}}}.
742 \IT{(\MC*{DOTIMES} (\VAR{var} \VAR{integer} \Op{\VAR{result}}) %FIXME:BLOCK
743 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
744 \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
746 Evaluate \SO{TAGBODY}-like body with \VAR{var} successively bound
747 to integers from 0 to $\mbox{\VAR{integer}} - 1$. Upon evaluation of
748 \retval{\VAR{result}}, \VAR{var} is \NIL.
751 \IT{(\MC*{DOLIST }(\VAR{var} \VAR{list} \Op{\VAR{result}})
752 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
753 \Goos{\NEV{\VAR{tag}}\XOR\VAR{form}})}
755 Evaluate \SO{TAGBODY}-like body with \VAR{var} successively bound
756 to the elements of \VAR{list}. Upon evaluation of
757 \retval{\VAR{result}}, \VAR{var} is \NIL.
761 \end{LIST}
763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
764 \subsection{Loop Facility}
765 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
767 \begin{figure}%
768 \begin{center}%
769 \begin{sideways}%
771 \arraycolsep0pt
773 \text{\kwd{loop}}\text{ }
774 \Op{
775 \text{\LKWD{named} \VAR{n}}
777 \left\{
778 \begin{array}{l}
779 \text{\LKWD{with} \VAR{var} \Op{\VAR{type}} \LKWD{=} \VAR{foo }}
780 \{\text{\LKWD{and} \VAR{var-n} \Op{\VAR{type}} \LKWD{=}
781 \VAR{bar}\}}^{*} \\[.1ex]
782 \left.\!
783 \begin{array}{l}
784 \text{\LKWD{for}} \\
785 \text{\LKWD{as}}
786 \end{array}\right\}
787 \boxed{
788 \text{\VAR{var} [\VAR{type}]}
789 \left\{
790 \begin{array}{l}
791 \left.\!
792 \begin{array}{l}
793 \OP{
794 \left\{
795 \begin{array}{l}
796 \text{\LKWD{upfrom}}\\
797 \text{\LKWD{from}}
798 \end{array}
799 \right\}
800 \text{\VAR{start}\DF{\LIT{0}}}
801 }\text{ }
802 \OP{
803 \left\{
804 \begin{array}{l}
805 \text{\LKWD{upto}}\\
806 \text{\LKWD{to}}\\
807 \text{\LKWD{below}}
808 \end{array}
809 \right\}
810 \text{\VAR{form}}
812 \text{\LKWD{from} \VAR{start}}
813 \left\{
814 \begin{array}{l}
815 \text{\LKWD{downto}}\\
816 \text{\LKWD{above}}
817 \end{array}
818 \right\}
819 \text{\VAR{form }}\\
820 \text{\LKWD{downfrom} \VAR{start}}\text{ }
821 \OP{
822 \left\{
823 \begin{array}{l}
824 \text{\LKWD{downto}}\\
825 \text{\LKWD{to}}\\
826 \text{\LKWD{above}}
827 \end{array}
828 \right\}
829 \text{\VAR{form}}
831 \end{array}
832 \right\}
833 \Op{
834 \text{\LKWD{by} \VAR{step}\DF{\LIT{1}}}
836 \left.\!
837 \begin{array}{l}
838 \text{\LKWD{in}} \\
839 \text{\LKWD{on}}
840 \end{array}
841 \right\}
842 \text{\VAR{list}}\text{ }
843 \Op{
844 \text{\LKWD{by} \VAR{function}\DF{\kwd{cdr}}}
846 \text{\LKWD{=} \VAR{foo }}
847 \Op{
848 \text{\LKWD{then} \VAR{bar}}
850 \text{\LKWD{across} \VAR{vector}}\\
851 \text{\LKWD{being}}
852 \left\{
853 \begin{array}{l}
854 \text{\LKWD{the}}\\
855 \text{\LKWD{each}}
856 \end{array}
857 \right\}%
858 \left\{
859 \begin{array}{{l}}
860 \left.\!
861 \begin{array}{l}
862 \left.\!
863 \begin{array}{l}
864 \text{\LKWD{hash-key}}\\
865 \text{\LKWD{hash-keys}}
866 \end{array}
867 \right\}%
868 \left\{
869 \begin{array}{l}
870 \text{\LKWD{of}}\\
871 \text{\LKWD{in}}
872 \end{array}
873 \right\}
874 \text{\VAR{hash }}
875 \Op{
876 \text{\LKWD{using} (\LKWD{hash-value} \VAR{v})}
878 \left.\!
879 \begin{array}{l}
880 \text{\LKWD{hash-value}}\\
881 \text{\LKWD{hash-values}}
882 \end{array}
883 \right\}%
884 \left\{
885 \begin{array}{l}
886 \text{\LKWD{of}}\\
887 \text{\LKWD{in}}
888 \end{array}
889 \right\}
890 \text{\VAR{hash }}
891 \Op{
892 \text{\LKWD{using} (\LKWD{hash-key} \VAR{k})}
894 \end{array}
895 \right.\\
896 \left.\!
897 \begin{array}{l}
898 \text{\LKWD{symbol\Op{s}}}\\
899 \text{\LKWD{present-symbol\Op{s}}}\\
900 \text{\LKWD{external-symbol\Op{s}}}
901 \end{array}
902 \right\}%
903 \OP{
904 \left\{
905 \begin{array}{l}
906 \text{\LKWD{of}}\\
907 \text{\LKWD{in}}
908 \end{array}
909 \right\} \text{\VAR{package}\DF{\V{\A package\A}}}
911 \end{array}
912 \right.
913 \end{array}
914 \right\}_{\displaystyle{\mathbb{F}_0}}
915 }%boxed
916 \left\{
917 \text{\LKWD{and} }\boxed{\mathbb{F}_i\!}
918 \right\}^{\!*}\\
919 \\[-2.4ex]
920 \left.\!%
921 \begin{array}{l}
922 \text{\LKWD{initially}} \\
923 \text{\LKWD{finally}}
924 \end{array}
925 \right\}
926 \text{\VAR{form}}^{+} \\
928 \end{array}
929 \right\}^{\!\!\displaystyle{*}}
930 %Bottleneck
931 \left\{
932 \begin{array}{l}
933 \text{\LKWD{repeat} \VAR{num}}\\
934 \left.\!
935 \begin{array}{l}
936 \text{\LKWD{while}}\\
937 \text{\LKWD{until}}\\
938 \text{\LKWD{always}}\\
939 \text{\LKWD{never}}\\
940 \text{\LKWD{thereis}}
941 \end{array}
942 \right\}
943 \text{\VAR{test}}\\
944 \boxed{
945 \left.\!
946 \begin{array}{l}
947 \left.\!
948 \begin{array}{l}
949 \text{\LKWD{do}}\\
950 \text{\LKWD{doing}}
951 \end{array}
952 \right\}
953 \text{\VAR{form}}^{+}\\
954 \text{\LKWD{return}}
955 \left\{
956 \begin{array}{l}
957 \text{\VAR{form}}\\
958 \text{\LKWD{it}}
959 \end{array}
960 \right.\\
961 \left.\!
962 \begin{array}{l}
963 \text{\LKWD{collect\Op{ing}}}\\
964 \text{\LKWD{append\Op{ing}}}\\
965 \text{\LKWD{nconc\Op{ing}}}
966 \end{array}
967 \right\}
968 \left\{
969 \begin{array}{l}
970 \text{\VAR{form}}\\
971 \text{\LKWD{it}}
972 \end{array}
973 \right\} \Op{\text{\LKWD{into }\VAR{var}}}\\
974 \left.\!
975 \begin{array}{l}
976 \text{\LKWD{count\Op{ing}}}\\
977 \text{\LKWD{sum\Op{ming}}}\\
978 \text{\LKWD{maximize}}\\
979 \text{\LKWD{maximizing}}\\
980 \text{\LKWD{minimize}}\\
981 \text{\LKWD{minimizing}}
982 \end{array}
983 \right\}
984 \left\{
985 \begin{array}{l}
986 \text{\VAR{form}}\\
987 \text{\LKWD{it}}
988 \end{array}
989 \right\}
990 \Op{\text{\LKWD{into }\VAR{num}}}\text{ }
991 \Op{\text{\VAR{type}}}\\
992 \left.\!
993 \begin{array}{l}
994 \text{\LKWD{if}}\\
995 \text{\LKWD{when}}\\
996 \text{\LKWD{unless}}
997 \end{array}
998 \right\}%
999 \text{\VAR{test }}
1000 \boxed{\mathbb{C}_i\!}\{\text{\LKWD{and}}
1001 \boxed{\mathbb{C}_j\!}\}^{*}\Op{\text{\LKWD{else}}
1002 \boxed{\mathbb{C}_k\!}\{\text{\LKWD{and}}
1003 \boxed{\mathbb{C}_l\!}\}^{*}}
1004 \Op{\text{\LKWD{end}}}
1005 \end{array}
1006 \right._{\!\!\!\!\displaystyle{\mathbb{C}_0}}
1007 }%boxed
1009 \\[-2.4ex]
1010 \left.\!
1011 \begin{array}{l}
1012 \text{\LKWD{initially}} \\
1013 \text{\LKWD{finally}}
1014 \end{array}
1015 \right\}
1016 \text{\VAR{form}}^{+}
1017 \end{array}
1018 \right\}^{\displaystyle{\!\!*}}
1020 \!)%
1021 \end{sideways}%
1022 \end{center}\vspace{-1em}
1023 \caption{Loop Facility, Overview.\label{loop-overview}}%
1024 \end{figure}
1027 \begin{LIST}{1cm}
1029 \IT{(\MC*{LOOP} \OPn{\VAR{form}})} %FIXME:BLOCK
1031 Simple Loop. If \VAR{form}s do not contain any Loop Facility
1032 keywords, evaluate them forever.
1035 \IT{(\MC*{LOOP} \OPn{\VAR{form}})} %FIXME:BLOCK;TAGBODY
1037 Loop Facility. For Loop Facility keywords
1038 see below and Figure \ref{loop-overview}.
1041 \begin{LIST}{.5cm}
1043 \IT{\LKWD*{named} \VAR{n}}
1045 Give implicit \kwd{block} of loop a name.
1048 \IT{\LKWD*{with} \VAR{var} \Op{\VAR{type}} \LKWD*{=} \VAR{foo} \Goos{\LKWD*{and}
1049 \VAR{var-n} \Op{\VAR{type}} \LKWD*{=} \VAR{bar}}}
1051 Initialize local variables in parallel.
1054 \IT{\Goo{\LKWD*{initially}\XOR\LKWD*{finally}} \RP{\VAR{form}}}
1056 Evaluate \VAR{form}s before begin, or after end, respectively, of iterations.
1059 \IT{\Goo{\LKWD*{for}\XOR\LKWD*{as}\XOR\LKWD*{and}} \VAR{var} \Op{\VAR{type}}}
1061 Begin of iteration control clauses; \VAR{var}s are initialized and
1062 stepped in parallel.
1065 \begin{LIST}{.5cm}
1067 \IT{\Goo{\LKWD*{upfrom}\XOR\LKWD*{from}\XOR\LKWD*{downfrom}}
1068 \VAR{start}}
1070 Start stepping with \VAR{start}
1073 \IT{\Goo{\LKWD*{upto}\XOR\LKWD*{downto}\XOR\LKWD*{to}\XOR\LKWD*{below}\XOR\LKWD*{above}}
1074 \VAR{form}}
1076 Specify \VAR{form} as the end value for stepping.
1079 \IT{\Goo{\LKWD*{in}\XOR\LKWD*{on}} \VAR{list}}
1081 Bind \VAR{var} to successive elements/tails, respectively, of \VAR{list}.
1084 \IT{\LKWD*{by} \Goo{\VAR{step}\DF{\LIT{1}}\XOR\VAR{function}\DF{\FU{cdr}}}}
1086 Specify the (positive) decrement or increment or the
1087 \VAR{function} of one argument returning the next part of the list.
1090 \IT{\LKWD*{=} \VAR{foo} \Op{\LKWD*{then}
1091 \VAR{bar}\DF{\VAR{foo}}}}
1093 Bind \VAR{var} in the first iteration to \VAR{foo} and later to \VAR{bar}.
1096 \IT{\LKWD*{across} \VAR{vector}}
1098 Bind \VAR{var} to successive elements of \VAR{vector}.
1101 \IT{\LKWD*{being} \Goo{\LKWD*{the}\XOR\LKWD*{each}}}
1103 Iterate over a hash table or a package.
1106 \begin{LIST}{.5cm}
1108 \IT{\Goo{\LKWD*{hash-key}\XOR\LKWD*{hash-keys}} \Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table}
1109 \Op{\LKWD*{using} (\LKWD*{hash-value} \VAR{value})}}
1111 Bind \VAR{var} successively to the keys of \VAR{hash-table}; bind \VAR{value} to corresponding values.
1114 \IT{\Goo{\LKWD*{hash-value}\XOR\LKWD*{hash-values}} \Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table}
1115 \Op{\LKWD*{using} (\LKWD*{hash-key} \VAR{key})}}
1117 Bind \VAR{var} successively to the values of \VAR{hash-table}; bind \VAR{key} to corresponding keys.
1120 \IT{\Goo{\LKWD*{symbol}\XOR\LKWD*{symbols}\XOR\LKWD*{present-symbol}\XOR\LKWD*{present-symbols}\XOR\LKWD*{external-symbol}\XOR\LKWD*{external-symbols}}
1121 \Op{\Goo{\LKWD*{of}\XOR\LKWD*{in}}
1122 \VAR{package}\DF{\V{\A package\A}}}}
1124 Bind \VAR{var} successively to the symbols, or the present
1125 symbols, or the external symbols respectively, of
1126 \VAR{package}.
1129 \end{LIST}
1130 \end{LIST}
1132 \IT{\Goo{\LKWD*{do}\XOR\LKWD*{doing}} \RP{\VAR{form}}}
1134 Evaluate \VAR{form}s in every iteration.
1137 \IT{\LKWD*{it}}
1139 Value of \VAR{test} form of an enclosing \LKWD{if},
1140 \LKWD{when}, \LKWD{unless}, or \LKWD{else} clause.
1143 \IT{\LKWD*{return} \Goo{\VAR{form}\XOR\LKWD*{it}}}
1145 Return immediately, skipping any \LKWD{finally} parts, with value of \VAR{form} or \LKWD{it}.
1148 \IT{\Goo{\LKWD*{collect}\XOR\LKWD*{collecting}}
1149 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into} \VAR{list}}}
1151 Collect values of \VAR{form} or \LKWD{it} into \VAR{list}. If no
1152 \VAR{list} is given, collect into an anonymous list which is
1153 returned after termination.
1156 \IT{\Goo{\LKWD*{append}\XOR\LKWD*{appending}\XOR\LKWD*{nconc}\XOR\LKWD*{nconcing}}
1157 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1158 \VAR{list}}}
1160 Concatenate values of \VAR{form} or \LKWD{it}, which should be
1161 lists, into \VAR{list} by the means of \FU{append} or \FU{nconc},
1162 respectively. If no \VAR{list} is given, collect into an
1163 anonymous list which is returned after termination.
1166 \IT{\Goo{\LKWD*{count}\XOR\LKWD*{counting}}
1167 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1168 \VAR{n}} \Op{\VAR{type}}}
1170 Count the number of times the value of \VAR{form} or of \LKWD{it} is \T.
1171 If no \VAR{n} is given, count into an anonymous variable
1172 which is returned after termination.
1175 \IT{\Goo{\LKWD*{sum}\XOR\LKWD*{summing}}
1176 \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1177 \VAR{sum}} \Op{\VAR{type}}}
1179 Calculate the sum of the values of \VAR{form} or of \LKWD{it}.
1180 If no \VAR{sum} is given, sum into an anonymous variable
1181 which is returned after termination.
1184 \IT{\Goo{\LKWD*{maximize}\XOR\LKWD*{maximizing}\XOR
1185 \LKWD*{minimize}\XOR
1186 \LKWD*{minimizing}} \Goo{\VAR{form}\XOR\LKWD*{it}} \Op{\LKWD*{into}
1187 \VAR{max-min}} \Op{\VAR{type}}}
1189 Determine the maximum or minimum, respectively, of the values of
1190 \VAR{form} or of \LKWD{it}.
1191 If no \VAR{max-min} is given, use an anonymous variable
1192 which is returned after termination.
1195 \IT{\Goo{\LKWD*{if}\XOR\LKWD*{when}\XOR\LKWD*{unless}} \VAR{ test}
1196 \VAR{i-form} \Goos{\LKWD*{and}
1197 \VAR{j-form}} \Op{\LKWD*{else} \VAR{k-form} \Goos{\LKWD*{and}
1198 \VAR{l-form}}} \Op{\LKWD*{end}}}
1200 If \VAR{test} returns \T, \T, or \NIL, respectively, evaluate
1201 \VAR{i-form} and \VAR{j-form}s; otherwise, evaluate \VAR{k-form}
1202 and \VAR{l-form}s. Inside \VAR{i-form} and \VAR{k-form}, the value
1203 of \VAR{test} is accessible by \LKWD*{it}.
1206 \IT{\LKWD*{repeat} \VAR{num}}
1208 Terminate \MC{loop} after \VAR{num} times; \VAR{num} is evaluated once.
1211 \IT{\Goo{\LKWD*{while}\XOR\LKWD*{until}} \VAR{test}}
1213 Continue iteration until \VAR{test} returns \NIL\ or \T, respectively.
1216 \IT{\Goo{\LKWD*{always}\XOR\LKWD{never}} \VAR{test}}
1218 Terminate \MC{loop} returning \NIL\ and skipping any
1219 \LKWD*{finally} parts as soon as \VAR{test} is \NIL\ or \T,
1220 respectively. Otherwise continue \MC{loop} with its default return
1221 value set to \T.
1224 \IT{\LKWD*{thereis} \VAR{test}}
1226 Terminate \MC{loop} when \VAR{test} is \T\ and return value of
1227 \VAR{test}, skipping any \LKWD*{finally} parts. Otherwise continue
1228 \MC{loop} with its default return value set to \NIL.
1231 \IT{\LKWD*{loop-finish}}
1233 Terminate \MC{loop} immediately returning any accumulated results.
1235 \end{LIST}
1236 \end{LIST}
1241 % LocalWords: pt