cosmetic surgery on loop figure; a few minor changes elsewhere
[clqr.git] / clqr-input-output.tex
blobb0ea7ff63676f60cc90d1345c0826bc536b515cb
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{Input/Output}
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 \subsection{Predicates}
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18 \begin{LIST}{1cm}
20 \IT{\arrGOO{(\FU*{STREAMP} \VAR{ foo})\\
21 (\FU*{PATHNAMEP} \VAR{ foo})\\
22 (\FU*{READTABLEP} \VAR{ foo})}{.}}
24 \retval{\T} if \VAR{foo} is of indicated type.
27 \IT{\arrGOO{(\FU*{INPUT-STREAM-P} \VAR{ stream})\\
28 (\FU*{OUTPUT-STREAM-P} \VAR{ stream})\\
29 (\FU*{INTERACTIVE-STREAM-P} \VAR{ stream})\\
30 (\FU*{OPEN-STREAM-P} \VAR{ stream})}{.}}
32 Return \retval{\T} if \VAR{stream} is for input, for output,
33 interactive, or open, respectively.
36 \IT{(\FU*{PATHNAME-MATCH-P} \VAR{path} \VAR{wildcard})}
38 \retval{\T} if \VAR{path} matches \VAR{wildcard}.
41 \IT{(\FU*{WILD-PATHNAME-P} \VAR{path}
42 \OP{\Goo{\kwd{:host}\XOR
43 \kwd{:device}\XOR
44 \kwd{:directory}\XOR
45 \kwd{:name}\XOR
46 \kwd{:type}\XOR
47 \kwd{:version}\XOR\NIL}})}
49 Return \retval{\T} if indicated component in \VAR{path} is
50 wildcard. (\NIL\ indicates any component.)
53 \end{LIST}
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 \subsection{Reader}
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 \begin{LIST}{1cm}
62 \IT{(\xorGOO{\FU*{Y-OR-N-P}\\
63 \FU*{YES-OR-NO-P}}{\}} \Op{\VAR{control} \OPn{\VAR{arg}}})}
65 Ask user a question and return \retval{\T} or \retval{\NIL}
66 depending on their answer. See p.\ \pageref{section:Format},
67 \FU{format}, for \VAR{control} and \VAR{arg}s.
70 \IT{(\MC*{WITH-STANDARD-IO-SYNTAX} \OPn{\VAR{form}})}
72 Evaluate \VAR{form}s with standard behaviour of reader and
73 printer. Return \retval{values of \VAR{form}s}.
76 \IT{(\xorGOO{\FU*{READ}\\
77 \FU*{READ-PRESERVING-WHITESPACE}}{\}}
78 \OP{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}} \OP{\VAR{eof-err}\DF{\T}
79 \Op{\VAR{eof-val}\DF{\NIL} \Op{\VAR{recursive}\DF{\NIL}}}}})}
81 Read printed representation of \retval{object}.
84 \IT{(\FU*{READ-FROM-STRING} \VAR{string} \OP{\VAR{eof-error}\DF{\T}
85 \Op{\VAR{eof-val}\DF{\NIL}}}
86 \orGOO{%
87 \kwd{:start}\VAR{ start}\DF{\LIT{0}}\\
88 \kwd{:end}\VAR{ end}\DF{\NIL}\\
89 \kwd{:preserve-whitespace}\VAR{ bool}\DF{\NIL}}{\}})}
91 Return \retval{object} read from string and zero-indexed \retvalii{position} of
92 next character.
95 \IT{(\FU*{READ-DELIMITED-LIST} \VAR{char}
96 \OP{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}}
97 \Op{\VAR{recursive}\DF{\NIL}}})}
99 Continue reading until encountering \VAR{char}. Return \retval{list}
100 of objects read. Signal error if no \VAR{char} is found in stream.
103 \IT{(\FU*{READ-CHAR} \OP{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}}
104 \OP{\VAR{eof-err}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL}
105 \Op{\VAR{recursive}\DF{\NIL}}}}})}
107 Return \retval{next character} from \VAR{stream}.
110 \IT{(\FU*{READ-CHAR-NO-HANG}
111 \OP{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}}
112 \OP{\VAR{eof-error}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL}
113 \Op{\VAR{recursive}\DF{\NIL}}}}})}
115 \retval{Next character} from \VAR{stream} or \retval{\NIL} if none
116 is available.
119 \IT{(\FU*{PEEK-CHAR}
120 \OP{\VAR{mode}\DF{\NIL} \OP{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}}
121 \OP{\VAR{eof-error}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL}
122 \Op{\VAR{recursive}\DF{\NIL}}}}}})}
124 Next, or if \VAR{mode} is \T, next non-whitespace
125 \retval{character}, or if \VAR{mode} is a character, \retval{next instance}
126 of it, from stream without removing it there.
129 \IT{(\FU*{UNREAD-CHAR} \VAR{character}
130 \Op{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}}})}
132 Put last \FU{read-char}ed \VAR{character} back into \VAR{stream}; return
133 \retval{\NIL}.
136 \IT{(\FU*{READ-BYTE} \DES{\VAR{stream}} \OP{\VAR{eof-err}\DF{\T}
137 \Op{\VAR{eof-val}\DF{\NIL}}})}
139 Return \retval{next byte} from binary \VAR{stream}.
142 \IT{(\FU*{READ-LINE} \OP{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}}
143 \OP{\VAR{eof-err}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL}
144 \Op{\VAR{recursive}\DF{\NIL}}}}})}
146 Return a \retval{line of text} from \VAR{stream} and
147 \retvalii{\T} if line has been ended by end of file.
150 \IT{(\FU*{READ-SEQUENCE} \DES{\VAR{sequence}} \DES{\VAR{stream}}
151 \Op{\kwd{:start} \VAR{start}\DF{\LIT{0}}}\Op{\kwd{:end}
152 \VAR{end}\DF{\NIL}})}
154 Replace elements of \VAR{sequence} between \VAR{start} and \VAR{end}
155 with elements from \VAR{stream}. Return \retval{index} of
156 \VAR{sequence}'s first unmodified
157 element.
160 \IT{(\FU*{READTABLE-CASE} \VAR{readtable})\DF{\kwd{:upcase}}}
162 \retval{Case sensitivity attribute} (one of \kwd{:upcase},
163 \kwd{:downcase}, \kwd{:preserve}, \kwd{:invert}) of
164 \VAR{readtable}. \kwd{setf}able.
167 \IT{(\FU*{COPY-READTABLE} \OP{\VAR{from-readtable}\DF{\V{\A readtable\A}}
168 \Op{\DES{\VAR{to-readtable}}\DF{\NIL}}})}
170 Return \retval{copy of \VAR{from-readtable}}.
173 \IT{(\FU*{SET-SYNTAX-FROM-CHAR} \VAR{to-char} \VAR{from-char}
174 \OP{\DES{\VAR{to-readtable}}\DF{\V{\A readtable\A}}
175 \Op{\VAR{from-readtable}\DF{standard readtable}}})}
177 Copy syntax of \VAR{from-char} to \VAR{to-readtable}. Return \retval{\T}.
180 \IT{\V*{\A readtable\A}}
182 Current readtable.
185 \IT{\V*{\A read-base\A}\DF{\LIT{10}}}
187 Radix for reading \kwd{integer}s and \kwd{ratio}s.
190 \IT{\V*{\A read-default-float-format\A}\DF{\kwd{single-float}}}
192 Floating point format to use when not indicated in the number read.
195 \IT{(\FU*{SET-MACRO-CHARACTER} \VAR{char} \VAR{function}
196 \OP{\VAR{non-term-p}\DF{\NIL}
197 \Op{\DES{\VAR{rt}}\DF{\V{\A readtable\A}}}})}
199 Make \VAR{char} a macro character associated with
200 \VAR{function}. Return \retval{\T}.
203 \IT{(\FU*{GET-MACRO-CHARACTER} \VAR{char}
204 \Op{\VAR{rt}\DF{\V{\A readtable\A}}})}
206 \retval{Reader macro function} associated with \VAR{char}, and
207 \retvalii{\T} if \VAR{char} is a non-terminating macro character.
210 \IT{(\FU*{MAKE-DISPATCH-MACRO-CHARACTER} \VAR{char}
211 \OP{\VAR{non-term-p}\DF{\NIL}
212 \Op{\VAR{rt}\DF{\V{\A readtable\A}}}})}
214 Make \VAR{char} a dispatching macro character. Return \retval{\T}.
217 \IT{(\FU*{SET-DISPATCH-MACRO-CHARACTER} \VAR{char} \VAR{sub-char} \VAR{function}
218 \Op{\DES{\VAR{rt}}\DF{\V{\A readtable\A}}})}
220 Make \VAR{function} a dispatch function of \VAR{char} followed by
221 \VAR{sub-char}. Return \retval{\T}.
224 \IT{(\FU*{GET-DISPATCH-MACRO-CHARACTER} \VAR{char} \VAR{sub-char}
225 \Op{\VAR{rt}\DF{\V{\A readtable\A}}})}
227 \retval{Dispatch function} associated with \VAR{char} followed by \VAR{sub-char}.
230 \end{LIST}
232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
233 \subsection[Macro Chars]{Macro Characters and Escapes}
234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236 \begin{LIST}{1cm}
238 \IT{\arrGOO{%
239 \KWD{\#\boldmath$|$ }\OPn{\VAR{multi-line-comment}}\KWD{ \boldmath$|$\#}\\
240 \KWD*{; }\OPn{\VAR{one-line-comment}}}{.}}
241 {\index{\#{$"|$}{$"|$}\#}
242 Comments. There are conventions:
244 \begin{LIST}{.5cm}
245 \IT{\KWD{;;;;} \VAR{title}}
246 {Short title for a block of code.}
248 \IT{\KWD{;;;} \VAR{intro}}
249 {Description before a block of code.}
251 \IT{\KWD{;;} \VAR{state}}
252 {State of program or of following code.}
254 \IT{\KWD{;} \VAR{explanation}}
255 {Regarding line on which it appears.}
257 \end{LIST}
259 \IT{\KWD*{(}}
261 Initiate reading of a list.
264 \IT{\KWD{"}}\index{""}
266 Begin and end of a string.
269 \IT{\KWD*{'}\VAR{foo}}
271 (\SO{quote} \VAR{foo}); \VAR{foo} unevaluated
274 \IT{\KWD{\char18}(\Op{\VAR{foo}} \Op{\KWD*{,}\VAR{bar}} \Op{\KWD{,@}\VAR{baz}}
275 \Op{\KWD*{,.}\DES{\VAR{quux}}} \Op{\VAR{bing}})}
276 {\index{,"@}\index{`@\char18}
277 Backquote. \SO{quote} \VAR{foo} and \VAR{bing}; evaluate \VAR{bar}
278 and splice the lists \VAR{baz} and \VAR{quux} into their
279 elements. When nested, outermost commas inside the innermost
280 backquote expression belong to this backquote.
283 \IT{\KWD{\#\boldmath{$\backslash$}}\VAR{c}}
285 (\FU{character} \LIT{"}\VAR{c}\LIT{"}), the character \VAR{c}.
287 \index{\#@\#$\backslash$}%
289 \IT{\KWD*{\#b}, \KWD*{\#o}, \KWD*{\#x}, \KWD{\#}\VAR{n}\KWD{R}}
291 \index{\#R}%
292 Binary, octal or hexadecimal number, or number of radix \VAR{n}.
295 \IT{\KWD*{\#C(}\VAR{a b}\kwd{)}}
297 (\FU{complex} \VAR{a} \VAR{b}), the complex number $\VAR{a}+\VAR{b}\text{i}$.
300 \IT{\KWD*{\#'}\VAR{foo}}
302 (\SO{function} \VAR{foo}); the function named \VAR{foo}.
305 \IT{\KWD{\#}\VAR{n}\KWD{A}\VAR{sequence}}
307 \index{\#A}%
308 \VAR{n}-dimensional array.
311 \IT{\KWD{\#}\Op{\VAR{n}}\kwd{(}\OPn{\VAR{foo}}\kwd{)}}
313 \index{\#(}%
314 Vector of some (or \VAR{n})
315 \VAR{foo}s filled with last \VAR{foo} if necessary.
318 \IT{\KWD{\#}\Op{\VAR{n}}\kwd{\A}\OPn{\VAR{b}}}
320 \index{\#\A}%
321 Bit vector of some (or \VAR{n})
322 \VAR{b}s filled with last \VAR{b} if necessary.
325 \IT{\KWD*{\#S(}\VAR{type} \Goos{\VAR{slot} \VAR{value}}\kwd{)}}
327 Structure of \VAR{type}.
330 \IT{\KWD*{\#:}\VAR{foo}}
332 Uninterned Symbol \VAR{foo}.
335 \IT{\KWD*{\#.}\VAR{form}}
337 Read-time value of \VAR{form}.
340 \IT{\V*{\A read-eval\A}\DF{\T}}
342 If \NIL, a \kwd{reader-error} is signalled by \kwd{\#.}.
345 \IT{\KWD{\#}\VAR{label}\kwd{=} \VAR{foo}}
347 \index{\#=}%
348 Give value of \VAR{foo} a \VAR{label}.
351 \IT{\KWD{\#}\VAR{label}\kwd{\#}}
353 \index{\#\#}%
354 Object labelled \VAR{label}.
357 \IT{\KWD*{\#P}\VAR{foo}}
359 A pathname.
362 \IT{\KWD{\#\boldmath$<$}}
364 \index{\#<@\#$<$}%
365 Have the reader signal an error.
368 \IT{\KWD*{\#+}\VAR{feature-expression} \VAR{form}}
370 Means \VAR{form} if \VAR{feature-expression} returns \T, means whitespace
371 otherwise.
374 \IT{\KWD*{\#--}\VAR{feature-expression} \VAR{form}}
376 Means whitespace if \VAR{feature-expression} returns \T, means \VAR{form}
377 otherwise.
380 \IT{\arrGOO{%
381 \kwd{\boldmath$|$}\OPn{\VAR{c}}\kwd{\boldmath$|$}\\
382 \kwd{\boldmath$\backslash$}\VAR{c}%
383 }{.}}
385 Treat arbitrary character(s) \VAR{c} as alphabetic preserving case.
387 \index{\@{$\backslash$}}%
388 \index{\textbar\textbar@{$"|$}{$"|$}}%
390 \end{LIST}
393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
394 \subsection{Printer}
395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398 \begin{LIST}{1cm}
400 \IT{(\xorGOO{\FU*{PRIN1}\\
401 \FU*{PRINT}\\
402 \FU*{PPRINT}\\
403 \FU*{PRINC}}{\}}
404 \VAR{foo} \Op{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}})}
406 Print \retval{\VAR{foo}} to \VAR{stream} \FU{read}ably,
407 \FU{read}ably after a newline and followed by a space,
408 \FU{read}ably after a newline, or human-readably without any extra
409 characters, respectively.
412 \IT{\arrGOO{(\FU*{PRIN1-TO-STRING} \VAR{ foo})\\
413 (\FU*{PRINC-TO-STRING} \VAR{ foo})}{.}}
415 Print \VAR{foo} to \retval{\VAR{string}} \FU{read}ably or
416 human-readably, respectively.
419 \IT{(\GFU*{PRINT-OBJECT} \VAR{object} \DES{\VAR{stream}})}
421 Print \retval{\VAR{object}} to \VAR{stream}.
424 \IT{(\MC*{PRINT-UNREADABLE-OBJECT} (\VAR{foo} \DES{\VAR{stream}}
425 \orGOO{\kwd{:type } \VAR{bool}\\
426 \kwd{:identity } \VAR{bool}}{\}})
427 \PROGN{\VAR{form}})}
429 Enclosed in \kwd{\#\boldmath$<$} and \kwd{\boldmath$>$}, print
430 \VAR{foo} by means of \VAR{form}s to \VAR{stream}. Return \retval{\NIL}.
433 \IT{(\FU*{TERPRI} \Op{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}})}
435 Output a newline to \VAR{stream}. Return \retval{\NIL}.
438 \IT{(\FU*{FRESH-LINE})
439 \Op{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}}}
441 Output a newline to \VAR{stream} and return \retval{\T} unless \VAR{stream}
442 is already at the start of a line.
445 \IT{(\FU*{WRITE-CHAR} \VAR{char}
446 \Op{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}})}
448 Output \retval{\VAR{char}} to \VAR{stream}.
451 \IT{(\xorGOO{\FU*{WRITE-STRING}\\
452 \FU*{WRITE-LINE}}{\}} \VAR{string}
453 \OP{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}}
454 \orGOO{\kwd{:start} \VAR{ start}\DF{\LIT{0}}\\\kwd{:end} \VAR{
455 end}\DF{\NIL}}{\}})}
457 Write \retval{\VAR{string}} to \VAR{stream} without/with a trailing newline.
460 \IT{(\FU*{WRITE-BYTE} \VAR{byte} \DES{\VAR{stream}})}
462 Write \retval{\VAR{byte}} to binary \VAR{stream}.
465 \IT{(\FU*{WRITE-SEQUENCE} \VAR{sequence}
466 \DES{\VAR{stream}} \orGOO{\kwd{:start}\VAR{ start}\DF{\LIT{0}}\\
467 \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})}
469 Write elements of \retval{\VAR{sequence}} to \VAR{stream}.
472 \IT{(\xorGOO{\FU*{WRITE}\\
473 \FU*{WRITE-TO-STRING}}{\}} \VAR{foo} \orGOO{%
474 \kwd{:array} \VAR{ bool}\\
475 \kwd{:base} \VAR{ radix}\\
476 \kwd{:case} \xorGOO{\kwd{:upcase}\\
477 \kwd{:downcase}\\
478 \kwd{:capitalize}}{.}\\
479 \kwd{:circle} \VAR{ bool}\\
480 \kwd{:escape} \VAR{ bool}\\
481 \kwd{:gensym} \VAR{ bool}\\
482 \kwd{:length} \VAR{ int}\\
483 \kwd{:level} \VAR{ int}\\
484 \kwd{:lines} \VAR{ int}\\
485 \kwd{:miser-width} \VAR{ int}\\
486 \kwd{:pprint-dispatch} \VAR{ dispatch-table}\\
487 \kwd{:pretty} \VAR{ bool}\\
488 \kwd{:radix} \VAR{ bool}\\
489 \kwd{:readably} \VAR{ bool}\\
490 \kwd{:right-margin} \VAR{ int}\\
491 \kwd{:stream } \DES{\VAR{stream}}\DF{\V{\A standard-output\A}}%
492 }{\}})}
494 Print and return \retval{\VAR{foo}}, or print \VAR{foo} into
495 \retval{string}, respectively, after dynamically setting printer variables
496 corresponding to keyword parameters (\kwd{\A print-}\VAR{bar}\kwd{\A} becoming
497 \kwd{:}\VAR{bar}). (\kwd{:stream} keyword with \FU{write} only.)
500 \IT{(\xorGOO{\FU*{PPRINT-FILL}\\
501 \FU*{PPRINT-LINEAR}}{\}}
502 \DES{\VAR{stream}} \VAR{foo} \OP{\VAR{parenthesis}\DF{\T}
503 \Op{\VAR{noop}}})}
505 Print \VAR{foo} to \VAR{stream}. If \VAR{foo} is a list, print as
506 many elements per line as possible; or print either all elements on
507 one line or each on its own line, respectively. Return \retval{\NIL}.
510 \IT{(\FU*{PPRINT-TABULAR} \DES{\VAR{stream}} \VAR{foo}
511 \OP{\VAR{parenthesis}\DF{\T} \Op{\VAR{noop}
512 \Op{\VAR{n}\DF{\LIT{16}}}}})}
514 Print \VAR{foo} to \VAR{stream}. If \VAR{foo} is a list, print
515 elements in a table with column width \VAR{n} ems. Return \retval{\NIL}.
518 \IT{(\MC*{PPRINT-LOGICAL-BLOCK} (\DES{\VAR{stream}} \VAR{list}
519 \orGOO{\xorGOO{\kwd{:prefix} \VAR{ prefix}\\
520 \kwd{:per-line-prefix} \VAR{ per-line-prefix}}{\}}\\
521 \kwd{:suffix} \VAR{ suffix}\DF{\LIT{""}}}{\}})
522 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
524 Evaluate \VAR{form}s, which should print \VAR{list}, with
525 \VAR{stream} locally bound to a pretty
526 printing stream which outputs to the original \VAR{stream}. If
527 \VAR{list} is in fact not a list, it is printed by
528 \FU{write}. Return \retval{\NIL}.
531 \begin{LIST}{.5cm}
533 \IT{(\MC*{PPRINT-POP})}
535 Take \retval{next element} off \VAR{list}. If there is no remaining
536 list in \VAR{list}, or \V{\A print-length\A} or \V{\A print-circle\A} indicate
537 printing should end, send element together with an appropriate
538 indicator to \VAR{stream}.
541 \IT{(\FU*{PPRINT-TAB} \xorGOO{\kwd{:line}\\
542 \kwd{:line-relative}\\
543 \kwd{:section}\\
544 \kwd{:section-relative}}{\}} \VAR{c}
545 \VAR{i} \Op{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}})}
547 Move cursor forward to column number $c + ki$, $k \geq 0$ being as small
548 as possible.
551 \IT{(\FU*{PPRINT-INDENT} \xorGOO{%
552 \kwd{:block}\\
553 \kwd{:current}}{\}} \VAR{n}
554 \OP{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}})}
556 Specify indentation for innermost logical block relative to
557 leftmost position/to current position. Return \retval{\NIL}.
560 \IT{(\MC*{PPRINT-EXIT-IF-LIST-EXHAUSTED})}
562 If \VAR{list} is empty, terminate logical block. Return
563 \retval{\NIL} otherwise.
566 \end{LIST}
568 \IT{(\FU*{PPRINT-NEWLINE} \xorGOO{%
569 \kwd{:linear}\\
570 \kwd{:fill}\\
571 \kwd{:miser}\\
572 \kwd{:mandatory}}{\}}
573 \OP{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}})}
575 Print a conditional newline if \VAR{stream} is a pretty printing
576 stream. Return \retval{\NIL}.
579 \IT{\V*{\A print-array\A}}
581 If \T, print arrays \FU{read}ably.
584 \IT{\V*{\A print-base\A}\DF{\LIT{10}}}
586 Radix for printing rationals, between 2 and 36.
589 \IT{\V*{\A print-case\A}\DF{\kwd{:upcase}}}
591 Print symbol names all uppercase (\kwd{:upcase}), all lowercase
592 (\kwd{:downcase}), capitalized (\kwd{:capitalize}).
595 \IT{\V*{\A print-circle\A}\DF{\NIL}}
597 If \T, avoid indefinite recursion while printing circular
598 structure.
601 \IT{\V*{\A print-escape\A}\DF{\T}}
603 If \NIL, do not print escape characters and package prefixes.
606 \IT{\V*{\A print-gensym\A}\DF{\T}}
608 If \T, print \kwd{:\#} before uninterned symbols.
611 \IT{\arrGOO{\V*{\A print-length\A}\DF{\NIL}\\
612 \V*{\A print-level\A}\DF{\NIL}}{.}}
614 If integer, restrict printing of objects to that number per
615 level/to that depth.
618 \IT{\V*{\A print-lines\A}\DF{\NIL}}
620 Number of lines to pretty-print.
623 \IT{\V*{\A print-miser-width\A}}
625 Width below which a compact pretty-printing style is used.
628 \IT{\V*{\A print-pretty\A}}
630 If \T, print pretty.
633 \IT{\V*{\A print-radix\A}\DF{\NIL}}
635 If \T, print rationals with a radix indicator.
638 \IT{\V*{\A print-readably\A}\DF{\NIL}}
640 If \T, print \FU{read}ably or signal error
641 \kwd{print-not-readable}.
644 \IT{\V*{\A print-right-margin\A}\DF{\NIL}}
646 Right margin width in ems while pretty-printing.
649 \IT{(\FU*{SET-PPRINT-DISPATCH} \VAR{type} \VAR{function}
650 \OP{\VAR{priority}\DF{\LIT{0}}
651 \Op{\VAR{table}\DF{\V{\A print-pprint-dispatch\A}}}})}
653 Install entry comprising \VAR{function} of arguments stream and
654 object to print; and \VAR{priority} as
655 \VAR{type} into \VAR{table}. If \VAR{function}
656 is \NIL, remove \VAR{type} from \VAR{table}. Return \retval{\NIL}.
659 \IT{(\FU*{PPRINT-DISPATCH} \VAR{foo}
660 \Op{\VAR{table}\DF{\V{\A print-pprint-dispatch\A}}})}
662 Highest priority \retval{\VAR{function}} associated with type of
663 \VAR{foo}.
666 \IT{(\FU*{COPY-PPRINT-DISPATCH}
667 \Op{\VAR{table}\DF{\V{\A print-pprint-dispatch\A}}})}
669 Return \retval{copy of \VAR{table}} or, if \VAR{table} is \NIL,
670 initial value of \V{\A print-pprint-dispatch\A}.
673 \IT{\V*{\A print-pprint-dispatch\A}}
675 Current pretty print dispatch table.
678 \IT{\V*{\A read-suppress\A}\DF{\NIL}}
680 If \T, reader is syntactically more tolerant.
683 \end{LIST}
687 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
688 \subsection{Format}
689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
690 \label{section:Format}
692 \begin{LIST}{1cm}
694 \IT{(\MC*{FORMATTER} \VAR{control})}
696 Return \retval{function} of stream and a \kwd{\&rest} argument applying \FU{format} to
697 stream, \VAR{control}, and the \kwd{\&rest} argument
698 returning \NIL\ or any excess arguments.
701 \IT{(\FU*{FORMAT} \Goo{\T\XOR\NIL\XOR\VAR{out-string}\XOR\VAR{out-stream}}
702 \VAR{control} \OPn{\VAR{arg}})}
704 Output string \VAR{control} which may
705 contain \kwd{\TLD} directives possibly taking some
706 \VAR{arg}s. Alternatively, \VAR{control} can be a function returned
707 by \MC{formatter} which is then applied to \VAR{out-stream} and \OPn{\VAR{arg}}.
708 Output to \VAR{out-string}, \VAR{out-stream} or, if first
709 argument is \T, to \V{\A standard-output\A}. Return \retval{\NIL}. If
710 first argument is \NIL, return \retval{formatted output}.
713 \begin{LIST}{.5cm}
715 \IT{\KWD{\TLD}\OP{\VAR{min-col}\DF{\LIT{0}} \OP{\KWD{,}\Op{\VAR{col-inc}\DF{\LIT{1}}}
716 \OP{\KWD{,}\Op{\VAR{min-pad}\DF{\LIT{0}}}
717 \OP{\KWD{,}\VAR{pad-char}\DF{\kwd{'}\textvisiblespace}}}}}
718 \KWD{\Op{:}\Op{@}\Goo{A\XOR S}}}
719 {\index{~ S@$\sim$S}
720 Print argument of any type for consumption by humans/by the
721 reader, respectively. With \kwd{:}, print \NIL\ as \LIT{()} rather
722 than \LIT{nil}; with \kwd{@}, add \VAR{pad-char}s on the left
723 rather than on the right.
726 \IT{\KWD{\TLD}\OP{\VAR{radix}\DF{\LIT{10}} \OP{\KWD{,}\Op{\VAR{width}}
727 \OP{\KWD{,}\Op{\VAR{pad-char}\DF{\kwd{'}\textvisiblespace}}
728 \OP{\KWD{,}\Op{\VAR{comma-char}\DF{\kwd{'}\LIT{,}}}
729 \OP{\KWD{,}\VAR{comma-interval}\DF{\LIT{3}}}}}}}
730 \KWD{\Op{:}\Op{@}R}}
731 {\index{~ R@$\sim$R}
732 Print argument as number; with \KWD{:}, group digits
733 \VAR{comma-interval} each; with \kwd{@}, always prepend a sign.
736 \IT{\Goo{\KWD{\TLD R}\XOR\KWD{\TLD :R}\XOR\KWD{\TLD
737 @R}\XOR\KWD{\TLD @:R}}}
739 Take argument as number and print it as English cardinal number,
740 as English ordinal number, as Roman numeral, or as old Roman
741 numeral, respectively.
744 \IT{\KWD{\TLD}\OP{\VAR{width}
745 \OP{\KWD{,}\Op{\VAR{pad-char}\DF{\kwd{'}\textvisiblespace}}
746 \OP{\KWD{,}\Op{\VAR{comma-char}\DF{\kwd{'}\LIT{,}}}
747 \OP{\KWD{,}\VAR{comma-interval}\DF{\LIT{3}}}}}}
748 \KWD{\Op{:}\Op{@}\Goo{D\XOR B\XOR O\XOR X}}}
749 {\index{~ D@$\sim$D}\index{~ B@$\sim$B}\index{~ O@$\sim$O}\index{~ X@$\sim$X}
750 Print integer argument as number (decimal, binary, octal, or
751 hexadecimal, respectively). With \kwd{:} group digits
752 \VAR{comma-interval} each; with \kwd{@}, always prepend a sign.
755 \IT{\KWD{\TLD}\OP{\VAR{width} \OP{\KWD{,}\Op{\VAR{dec-digits}} \OP{\KWD{,}\Op{\VAR{shift}\DF{\LIT{0}}}
756 \OP{\KWD{,}\Op{\VAR{overflow-char}}
757 \OP{\KWD{,}\VAR{pad-char}\DF{\kwd{'}\textvisiblespace}}}}}}
758 \KWD{\Op{@}F}}
759 {\index{~ F@$\sim$F}
760 Print argument as floating-point number. With \kwd{@}, always prepend a sign.
763 \IT{\KWD{\TLD}\OP{\VAR{width} \OP{\KWD{,}\Op{\VAR{int-digits}}
764 \OP{\KWD{,}\Op{\VAR{exp-digits}}
765 \OP{\KWD{,}\Op{\VAR{scale-factor}\DF{\LIT{1}}}
766 \OP{\KWD{,}\Op{\VAR{overflow-char}}
767 \OP{\KWD{,}\Op{\VAR{pad-char}\DF{\kwd{'}\textvisiblespace}}
768 \OP{\KWD{,}\VAR{exp-char}}}}}}}}
769 \KWD{\Op{@}\Goo{E\XOR G}}}
770 {\index{~ E@$\sim$E}\index{~ G@$\sim$G}
771 Print argument as floating-point number with \VAR{int-digits}
772 before decimal point and \VAR{exp-digits} in the
773 exponent. With \KWD{\TLD G}, chose either \KWD{\TLD E} or \KWD{\TLD F}. With \KWD{@}, always prepend a sign.
776 \IT{\Goo{\KWD{\TLD C}\XOR\KWD{\TLD :C}\XOR\KWD{\TLD
777 @C}\XOR\KWD{\TLD @:C}}}
778 {\index{~ C@$\sim$C}
779 Print, spell out, print in \kwd{\#$\backslash$} syntax, or tell how to type, respectively, argument as
780 (possibly non-printing) character.
783 \IT{\Goo{%
784 \KWD{\TLD(}\VAR{text}\KWD{\TLD)}\XOR
785 \KWD{\TLD:(}\VAR{text}\KWD{\TLD)}\XOR
786 \KWD{\TLD @(}\VAR{text}\KWD{\TLD)}\XOR
787 \KWD{\TLD:@(}\VAR{text}\KWD{\TLD)}}}
788 {\index{~ ()@$\sim$()}
789 Convert to lowercase, convert first letter of each word to
790 uppercase, capitalize first word and convert
791 the rest to lowercase, or convert to uppercase, respectively.
794 \IT{\Goo{\KWD{\TLD P}\XOR\KWD{\TLD:P}
795 \XOR\KWD{\TLD @P}\XOR\KWD{\TLD:@P}}}
796 {\index{~ P@$\sim$P}
797 If argument \kwd{eql} \LIT{1} print nothing, otherwise print \LIT{s};
798 do the same after backing up one argument; if argument \kwd{eql} \LIT{1}
799 print \LIT{y}, otherwise print \LIT{ies}; do the same after
800 backing up one argument, respectively.
803 \IT{\Goo{\KWD{\TLD\%}\XOR\KWD{\TLD}\VAR{n}\KWD{\%}}}
804 {\index{~\%@$\sim$\%}
805 Print one or \VAR{n} newline(s).
808 \IT{\Goo{\KWD{\TLD\&}\XOR\KWD{\TLD}\VAR{n}\KWD{\&}}}
809 {\index{~\&@$\sim$\&}
810 Print one or \VAR{n} newline(s) unless output stream is at the
811 beginning of a line.
814 \IT{\Goo{\KWD{\TLD\_}\XOR\KWD{\TLD:\_}\XOR\KWD{\TLD@\_}\XOR\KWD{\TLD:@\_}}}
815 {\index{~\_{}@$\sim$\_{}}
816 Print newline like \kwd{pprint-newline} with argument
817 \kwd{:linear}, \kwd{:fill}, \kwd{:miser}, or \kwd{:mandatory}, respectively.
820 \IT{\KWD{\TLD}\Op{\KWD{:}}\Op{\KWD{@}}$\hookleftarrow$}
822 (Tilde-newline) Ignore newline and following
823 whitespace. With \kwd{:}, ignore only newline; with \kwd{@},
824 ignore only following whitespace.
827 \IT{\Goo{\KWD{\TLD\boldmath$|$}\XOR\KWD{\TLD}\VAR{n}\KWD{\boldmath$|$}}}
828 {\index{~\textbar@$\sim${$"|$}}
829 Print one or \VAR{n} page separator(s).
832 \IT{\Goo{\KWD{\TLD\TLD}\XOR\KWD{\TLD}\VAR{n}\KWD{\TLD}}}
833 {\index{~~@$\sim$$\sim$}
834 Print one or \VAR{n} tilde(s).
837 \IT{\KWD{\TLD}\OP{\VAR{min-col}\DF{\LIT{0}}
838 \OP{\KWD{,}\Op{\VAR{col-inc}\DF{\LIT{1}}}
839 \OP{\KWD{,}\Op{\VAR{min-pad}\DF{\LIT{0}}}
840 \OP{\KWD{,}\VAR{pad-char}\DF{\kwd{'}\textvisiblespace}}}}}
841 \KWD{\Op{:}\Op{@}\boldmath{$<$}}
842 \Op{\VAR{text}\KWD{\TLD}\VAR{a},\VAR{b}\kwd{:;}}
843 \Goos{\VAR{text}\KWD{\TLD;}}\VAR{text} \KWD{\TLD\boldmath{$>$}}}
844 {\index{~< >@$\sim$$< >$}
845 Justify text produced by \VAR{text}s in a field of at least
846 \VAR{min-col} columns. With \kwd{:}, right justify; with \kwd{@},
847 left justify.
850 \IT{\KWD{\TLD}\OP{\VAR{c}\DF{\LIT{1}}\OP{\KWD{,}\VAR{i}\DF{\LIT{1}}}}\Op{\KWD{:}}\Op{\KWD{@}}\KWD{T}}
851 {\index{~ T@$\sim$T}
852 Move cursor forward to column number $c + ki$, $k \geq 0$ being as small
853 as possible. With \kwd{:}, calculate column numbers relative to
854 the immediately enclosing section. With \kwd{@}, move to column
855 number $c_0 + c + ki$ where $c_0$ is the current position.
858 \IT{\Goo{\KWD{\TLD}\Op{\VAR{n}\DF{\LIT{0}}}\kwd{I}\XOR\KWD{\TLD}\Op{\VAR{n}\DF{\LIT{0}}}\kwd{:I}}}
859 {\index{~ I@$\sim$I}
860 Same as (\kwd{pprint-indent} \kwd{:block} \VAR{n}) or
861 (\kwd{pprint-indent} \kwd{:current} \VAR{n}), respectively.
864 \IT{\KWD{\TLD}\Op{\VAR{n}\DF{\LIT{0}}}\Op{\KWD{:}}\Op{\KWD{@}}\KWD{\A}}
865 {\index{~ *@$\sim$\A}
866 Jump \VAR{n} arguments forward, or, with \kwd{:}, backward. With
867 \kwd{@}, jump to argument \VAR{n}.
870 \IT{\KWD{\TLD}\Op{\VAR{limit}}\Op{\KWD{{:}}\Op{\kwd{@}}}%
871 \KWD{\boldmath{$\{$}}\VAR{text}\KWD{\TLD\boldmath{$\}$}}}
872 {\index{~\{\}@$\sim$$\{\}$}
873 \VAR{text} is used repeatedly, up to \VAR{limit}, as control
874 string for every element of argument, which should be a list. With
875 \kwd{@}, take all remaining arguments. With \kwd{:}, argument should be
876 a list of sublists. At each iteration step the elements of a new
877 sublist are used by \VAR{text}.
880 \IT{\KWD{\TLD\^{}}}
881 {\index{~\^{}@$\sim$\^{}}
882 Leave immediately \kwd{\TLD\boldmath{$<$} \TLD\boldmath{$>$}} or
883 \kwd{\TLD\boldmath{$\{$} \TLD\boldmath{$\}$}}.
886 \IT{\KWD{\TLD}\Op{\VAR{i}}\Op{\KWD{:}}\Op{\KWD{@}}\KWD{[}\Op{\Goos{\VAR{text}\KWD{\TLD;}}\VAR{text}}\Op{\kwd{\TLD:;}\VAR{default}}\KWD{\TLD]}}
887 {\index{~ [ ]@$\sim$[ ]}
888 The \VAR{text}s are format control subclauses the zero-indexed argumenth (or the
889 \VAR{i}th if given) of which is chosen. With \kwd{:}, the argument
890 is boolean and takes first \VAR{text} for \NIL\ and second
891 \VAR{text} for \T. With \kwd{@}, the argument is boolean and if \T, takes
892 the only \VAR{text} and remains to be read; no \VAR{text} is
893 chosen and the argument isu sed up if it is \NIL.
896 \IT{\KWD{\TLD\Op{@}?}}
897 {\index{~ ?@$\sim$?}
898 Process two arguments as format string and argument list. With
899 \kwd{@}, take one argument as format string and use then the
900 original argument list.
903 \IT{\KWD{\TLD}\OP{\VAR{prefix}\Goos{\kwd{,} \VAR{prefix}}}\Op{\kwd{:}}\Op{\kwd{@}}\KWD{/}\VAR{function}\KWD{/}}
904 {\index{~//@$\sim$//}
905 Call \VAR{function} with the arguments stream, format-ar\-gu\-ment,
906 bool-colon, bool-at and \VAR{prefix}es for printing format-argument.
909 \IT{\KWD{\TLD\Op{:}\Op{@}W}}
910 {\index{~ W@$\sim$W}
911 Print obeying every printer control variable. With \kwd{:},
912 pretty-print. With \kwd{@}, print without limits on length or depth.
915 \IT{\Goo{\KWD{V}\XOR\KWD{\#}}}
916 {\index{V}
917 In place of the comma-separated prefix parameters: use next
918 argument or number of remaining unprocessed arguments, respectively.
921 \end{LIST}
923 \end{LIST}
926 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
927 \subsection{Streams}
928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
930 \begin{LIST}{1cm}
932 \IT{(\FU*{OPEN} \VAR{path}
933 \orGOO{\kwd{:direction} \xorGOO{\kwd{:input}\\
934 \kwd{:output}\\
935 \kwd{:io}\\
936 \kwd{:probe}}{\}}\DF{\kwd{:input}}\\
937 \kwd{:element-type} \VAR{ type}\DF{\kwd{character}}\\
938 \kwd{:if-exists}
939 \xorGOO{\kwd{:new-version}\\
940 \kwd{:error}\\
941 \kwd{:rename}\\
942 \kwd{:rename-and-delete}\\
943 \kwd{:overwrite}\\
944 \kwd{:append}\\
945 \kwd{:supersede}\\
946 \NIL}{.}\\
947 \kwd{:if-does-not exist} \xorGOO{\kwd{:error}\\
948 \kwd{:create}\\
949 \NIL}{.}\\
950 \kwd{:external-format } \VAR{format}\DF{\kwd{:default}}%
951 }{\}})}
953 Open \retval{\kwd{file-stream} to \VAR{path}}.
956 \IT{\arrGOO{%
957 (\FU*{MAKE-CONCATENATED-STREAM } \OPn{\VAR{input-stream}})\\
958 (\FU*{MAKE-BROADCAST-STREAM } \OPn{\VAR{output-stream}})\\
959 (\FU*{MAKE-TWO-WAY-STREAM } \VAR{input-stream-part } \VAR{output-stream-part})\\
960 (\FU*{MAKE-ECHO-STREAM } \VAR{from-input-stream } \VAR{to-output-stream})\\
961 (\FU*{MAKE-SYNONYM-STREAM } \VAR{variable-bound-to-stream})}{.}}
963 Return \retval{stream} of indicated type.
966 \IT{(\FU*{MAKE-STRING-INPUT-STREAM} \VAR{string}
967 \orGOO{\kwd{:start}\VAR{ start}\DF{\LIT{0}}\\
968 \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})}
970 Return a \retval{\kwd{string-stream}} supplying the characters from \VAR{string}.
973 \IT{(\FU*{MAKE-STRING-OUTPUT-STREAM} \Op{\kwd{:element-type}
974 \VAR{type}\DF{\kwd{character}}})}
976 Return a \retval{\kwd{string-stream}} accepting characters
977 (available via \FU{get-output-stream-string}).
980 \IT{\arrGOO{(\FU*{CONCATENATED-STREAM-STREAMS } \VAR{concatenated-stream})\\
981 (\FU*{BROADCAST-STREAM-STREAMS } \VAR{broadcast-stream})}{.}}
983 Return \retval{list of streams} \VAR{concatenated-stream} still
984 has to read from/\VAR{broadcast-stream} is
985 broadcasting to.
988 \IT{\arrGOO{%
989 (\FU*{TWO-WAY-STREAM-INPUT-STREAM} \VAR{ two-way-stream})\\
990 (\FU*{TWO-WAY-STREAM-OUTPUT-STREAM} \VAR{ two-way-stream})\\
991 (\FU*{ECHO-STREAM-INPUT-STREAM} \VAR{ echo-stream})\\
992 (\FU*{ECHO-STREAM-OUTPUT-STREAM} \VAR{ echo-stream})}{.}}
994 Return \retval{source stream} or \retval{sink stream}
995 of \VAR{two-way-stream}/\VAR{echo-stream}, respectively.
998 \IT{(\FU*{SYNONYM-STREAM-SYMBOL} \VAR{synonym-stream})}
1000 Return \retval{symbol} of \VAR{synonym-stream}.
1003 \IT{(\FU*{GET-OUTPUT-STREAM-STRING} \DES{\VAR{string-stream}})}
1005 Clear and return as a \retval{string} characters on \VAR{string-stream}.
1008 \IT{(\FU*{LISTEN} \Op{\VAR{stream}\DF{\V{\A standard-input\A}}})}
1010 \retval{\T} if there is a character in input \VAR{stream}.
1013 \IT{(\FU*{CLEAR-INPUT}
1014 \Op{\DES{\VAR{stream}}\DF{\V{\A standard-input\A}}})}
1016 Clear input from \VAR{stream}, return \retval{\NIL}.
1019 \IT{(\xorGOO{\FU*{CLEAR-OUTPUT}\\
1020 \FU*{FORCE-OUTPUT}\\
1021 \FU*{FINISH-OUTPUT}}{\}}
1022 \Op{\DES{\VAR{stream}}\DF{\V{\A standard-output\A}}})}
1024 End output to \VAR{stream} and return \retval{\NIL} immediately,
1025 after initiating flushing of buffers, or after flushing of buffers,
1026 respectively.
1029 \IT{(\FU*{CLOSE} \DES{\VAR{stream}} \Op{\kwd{:abort}
1030 \VAR{bool}\DF{\NIL}})}
1032 Close \VAR{stream}. Return \retval{\T} if \VAR{stream} had been
1033 open. If \kwd{:abort} is \T, delete associated file.
1036 \IT{(\MC*{WITH-OPEN-STREAM} (\VAR{foo} \DES{\VAR{stream}})
1037 \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
1039 Evaluate \VAR{form}s with \VAR{foo} locally bound to
1040 \VAR{stream}. Return \retval{values of \VAR{form}s}.
1043 \IT{(\MC*{WITH-INPUT-FROM-STRING} (\VAR{foo} \VAR{string}
1044 \orGOO{\kwd{:index } \DES{\VAR{index}}\\
1045 \kwd{:start} \VAR{ start}\\
1046 \kwd{:end} \VAR{ end}}{\}}) \OPn{(\kwd{declare}
1047 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
1049 Evaluate \VAR{form}s with \VAR{foo} locally bound to input stream
1050 from \VAR{string}. \VAR{index} contains the reading position in
1051 \VAR{string} after leaving. Return \retval{values of \VAR{form}s}.
1054 \IT{(\MC*{WITH-OUTPUT-TO-STRING} (\VAR{foo}
1055 \Op{\DES{\VAR{string}}\DF{\NIL}} \Op{\kwd{:element-type}
1056 \VAR{type}\DF{\kwd{character}}}) \OPn{(\kwd{declare}
1057 \OPn{\NEV{\VAR{decl}}})} \PROGN{\VAR{form}})}
1059 Evaluate \VAR{form}s with \VAR{foo} locally bound to output
1060 stream. Append output to \VAR{string} and return \retval{values of
1061 \VAR{form}s} if \VAR{string} is given. Return \retval{string
1062 containing output} otherwise.
1065 \IT{(\FU*{STREAM-EXTERNAL-FORMAT} \VAR{stream})}
1067 \retval{External file format designator}.
1070 \IT{\V*{\A terminal-io\A}}
1072 Bidirectional stream to user terminal.
1075 \IT{\arrGOO{\V*{\A standard-input\A}\\
1076 \V*{\A standard-output\A}\\
1077 \V*{\A error-output\A}}{.}}
1079 Standard input stream, standard output stream,
1080 or standard error output stream, respectively.
1083 \IT{\arrGOO{\V*{\A debug-io\A}\\
1084 \V*{\A query-io\A}}{.}}
1086 Streams for debugging and user interaction.
1089 \end{LIST}
1092 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1093 \subsection{Files}
1094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1096 \begin{LIST}{1cm}
1098 \IT{(\FU*{MAKE-PATHNAME}
1099 \orGOO{\kwd{:host} \VAR{ host}\\
1100 \kwd{:device} \VAR{ dev}\\
1101 \kwd{:directory} \VAR{ dir}\\
1102 \kwd{:name} \VAR{ name}\\
1103 \kwd{:type} \VAR{ type}\\
1104 \kwd{:version} \VAR{ ver}\\
1105 \kwd{:defaults} \VAR{ path}\\
1106 \kwd{:case
1107 \Goo{\kwd{:local}\XOR\kwd{:common}}\DF{\kwd{:local}}}}{\}})}
1109 Construct \retval{pathname}.
1112 \IT{(\FU*{MERGE-PATHNAMES} \VAR{pathname}
1113 \OP{\VAR{default-pathname}\DF{\V{\A default-pathname-defaults\A}}
1114 \Op{\VAR{version}\DF{\kwd{:newest}}}})}
1116 Return \retval{\VAR{pathname}} after filling in missing parts from defaults.
1119 \IT{\V*{\A default-pathname-defaults\A}}
1121 Pathname to use if one is needed but none supplied.
1124 \IT{(\FU*{PATHNAME} \VAR{path})}
1126 \retval{Pathname} of \VAR{path}.
1129 \IT{(\FU*{ENOUGH-NAMESTRING} \VAR{path}
1130 \Op{\VAR{root-path}\DF{\V{\A default-pathname-defaults\A}}})}
1132 Return \retval{minimal path string} to sufficiently describe
1133 \VAR{path} relative to \VAR{root-path.}
1136 \IT{\arrGOO{(\FU*{NAMESTRING}\VAR{ path})\\
1137 (\FU*{FILE-NAMESTRING}\VAR{ path})\\
1138 (\FU*{DIRECTORY-NAMESTRING}\VAR{ path})\\
1139 (\FU*{HOST-NAMESTRING}\VAR{ path})}{.}}
1141 Return string representing \retval{full pathname}; \retval{name, type, and version};
1142 \retval{directory name}; or \retval{host name}, respectively, of \VAR{path}.
1145 \IT{(\FU*{PARSE-NAMESTRING} \VAR{foo} \OP{\VAR{host}
1146 \Op{\VAR{default-pathname}\DF{\V{\A default-pathname-defaults\A}}}}
1147 \orGOO{\kwd{:start} \VAR{ start}\DF{\LIT{0}}\\
1148 \kwd{:end} \VAR{ end}\DF{\NIL}\\
1149 \kwd{:junk-allowed} \VAR{ bool}\DF{\NIL}}{\}})}
1151 Return \retval{pathname} converted from
1152 string, pathname, or stream \VAR{foo}; and \retvalii{position}
1153 where parsing stopped.
1156 \IT{(\xorGOO{\FU*{PATHNAME-HOST}\\
1157 \FU*{PATHNAME-DEVICE}\\
1158 \FU*{PATHNAME-DIRECTORY}\\
1159 \FU*{PATHNAME-NAME}\\
1160 \FU*{PATHNAME-TYPE}\\
1161 \FU*{PATHNAME-VERSION}}{\}}
1162 \VAR{path}
1163 \Op{\kwd{:case} \xorGOO{\kwd{:local}\\
1164 \kwd{:common}}{\}}\DF{\kwd{:local}}})}
1166 Return \retval{pathname component}.
1169 \IT{(\FU*{LOGICAL-PATHNAME} \VAR{path})}
1171 \retval{Logical name} of \VAR{path}.
1174 \IT{(\FU*{TRANSLATE-PATHNAME} \VAR{path-a} \VAR{path-b}
1175 \VAR{path-c})}
1177 Translate \VAR{path-a} from wildcard \VAR{path-b} into wildcard
1178 \VAR{path-c}. Return \retval{new path}.
1181 \IT{(\FU*{LOGICAL-PATHNAME-TRANSLATIONS} \VAR{host})}
1183 \retval{\VAR{host}'s list of translations}. \kwd{setf}able.
1186 \IT{(\FU*{LOAD-LOGICAL-PATHNAME-TRANSLATIONS} \VAR{host})}
1188 Load \VAR{host}'s translations. Return \retval{\NIL} if already
1189 loaded, return \retval{\T} if successful.
1192 \IT{(\FU*{TRANSLATE-LOGICAL-PATHNAME} \VAR{path})}
1194 Physical \retval{pathname} of \VAR{path}.
1197 \IT{\arrGOO{(\FU*{PROBE-FILE} \VAR{ file})\\
1198 (\FU*{TRUENAME} \VAR{ file})}{.}}
1200 \retval{Canonical name} of \VAR{file}. If \VAR{file} does not exist,
1201 return \retval{\NIL}/signal error, respectively.
1204 \IT{(\FU*{FILE-WRITE-DATE} \VAR{file})}
1206 \retval{Time} at which \VAR{file} was last written.
1209 \IT{(\FU*{FILE-AUTHOR} \VAR{file})}
1211 Return \retval{name of \VAR{file} owner}.
1214 \IT{(\FU*{FILE-LENGTH} \VAR{stream})}
1216 Return \retval{length of \VAR{stream}}.
1219 \IT{(\FU*{FILE-POSITION} \VAR{stream} \Op{\xorGOO{\kwd{:start}\\
1220 \kwd{:end}\\
1221 \VAR{position}}{\}}})}
1223 Return \retval{position within stream}, or set it to
1224 \retval{\VAR{position}} and return \retval{\T} on success.
1227 \IT{(\FU*{FILE-STRING-LENGTH} \VAR{stream} \VAR{foo})}
1229 \retval{Length} \VAR{foo} would have in \VAR{stream}.
1232 \IT{(\FU*{RENAME-FILE} \VAR{foo} \VAR{bar})}
1234 Rename file \VAR{foo} to \VAR{bar}. Unspecified parts of path
1235 \VAR{bar} default to those of \VAR{foo}. Return \retval{new
1236 pathname}, \retvalii{old file name}, and \retvaliii{new file name}.
1239 \IT{(\FU*{DELETE-FILE} \VAR{file})}
1241 Delete \VAR{file}, return \retval{\T}.
1244 \IT{(\FU*{DIRECTORY} \VAR{path})}
1246 Return \retval{list of pathnames}.
1249 \IT{(\FU*{ENSURE-DIRECTORIES-EXIST} \VAR{path} \Op{\kwd{:verbose}
1250 \VAR{bool}})}
1252 Create parts of \retval{\VAR{path}} if necessary. Second return value is
1253 \retvalii{\T} if something has been created.
1256 \IT{(\MC*{WITH-OPEN-FILE} (\VAR{stream} \VAR{path}
1257 \OPn{\VAR{open-arg}}) \OPn{(\kwd{declare} \OPn{\NEV{\VAR{decl}}})}
1258 \PROGN{\VAR{form}})}
1260 Use \FU*{OPEN} with \VAR{open-arg}s to temporarily
1261 create \VAR{stream} to \VAR{path}; return \retval{values of \VAR{form}s}.
1264 \IT{(\FU*{USER-HOMEDIR-PATHNAME} \Op{\VAR{host}})}
1266 User's \retval{home directory}.
1270 \end{LIST}
1274 % LocalWords: ies argumenth ar gu ment