| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>Streams and Reading (GCL SI Manual)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Streams and Reading (GCL SI Manual)"> |
| 9 |
<meta name="keywords" content="Streams and Reading (GCL SI Manual)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="Function-and-Variable-Index.html" rel="index" title="Function and Variable Index"> |
| 15 |
<link href="Function-and-Variable-Index.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| 16 |
<link href="index.html" rel="up" title="Top"> |
| 17 |
<link href="Special-Forms-and-Functions.html" rel="next" title="Special Forms and Functions"> |
| 18 |
<link href="Lists.html" rel="prev" title="Lists"> |
| 19 |
<style type="text/css"> |
| 20 |
<!-- |
| 21 |
a.summary-letter {text-decoration: none} |
| 22 |
blockquote.indentedblock {margin-right: 0em} |
| 23 |
div.display {margin-left: 3.2em} |
| 24 |
div.example {margin-left: 3.2em} |
| 25 |
div.lisp {margin-left: 3.2em} |
| 26 |
kbd {font-style: oblique} |
| 27 |
pre.display {font-family: inherit} |
| 28 |
pre.format {font-family: inherit} |
| 29 |
pre.menu-comment {font-family: serif} |
| 30 |
pre.menu-preformatted {font-family: serif} |
| 31 |
span.nolinebreak {white-space: nowrap} |
| 32 |
span.roman {font-family: initial; font-weight: normal} |
| 33 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 34 |
ul.no-bullet {list-style: none} |
| 35 |
--> |
| 36 |
</style> |
| 37 |
|
| 38 |
|
| 39 |
</head> |
| 40 |
|
| 41 |
<body lang="en"> |
| 42 |
<span id="Streams-and-Reading"></span><div class="header"> |
| 43 |
<p> |
| 44 |
Next: <a href="Special-Forms-and-Functions.html" accesskey="n" rel="next">Special Forms and Functions</a>, Previous: <a href="Lists.html" accesskey="p" rel="prev">Lists</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 45 |
</div> |
| 46 |
<hr> |
| 47 |
<span id="Streams-and-Reading-1"></span><h2 class="chapter">5 Streams and Reading</h2> |
| 48 |
|
| 49 |
<dl> |
| 50 |
<dt id="index-MAKE_002dECHO_002dSTREAM">Function: <strong>MAKE-ECHO-STREAM</strong> <em>(input-stream output-stream)</em></dt> |
| 51 |
<dd><p>Package:LISP |
| 52 |
</p> |
| 53 |
<p>Returns a bidirectional stream which gets its input from INPUT-STREAM and |
| 54 |
sends its output to OUTPUT-STREAM. In addition, all input is echoed to |
| 55 |
OUTPUT-STREAM. |
| 56 |
</p> |
| 57 |
|
| 58 |
</dd></dl> |
| 59 |
|
| 60 |
<dl> |
| 61 |
<dt id="index-_002aREADTABLE_002a">Variable: <strong>*READTABLE*</strong></dt> |
| 62 |
<dd><p>Package:LISP |
| 63 |
The current readtable. |
| 64 |
</p> |
| 65 |
|
| 66 |
</dd></dl> |
| 67 |
|
| 68 |
<dl> |
| 69 |
<dt id="index-LOAD">Function: <strong>LOAD</strong> <em>(filename &key (verbose *load-verbose*) (print nil) (if-does-not-exist :error))</em></dt> |
| 70 |
<dd><p>Package:LISP |
| 71 |
</p> |
| 72 |
<p>Loads the file named by FILENAME into GCL. |
| 73 |
</p> |
| 74 |
|
| 75 |
</dd></dl> |
| 76 |
|
| 77 |
<dl> |
| 78 |
<dt id="index-OPEN">Function: <strong>OPEN</strong> <em>(filename &key (direction :input) (element-type 'string-char) (if-exists :error) (if-does-not-exist :error))</em></dt> |
| 79 |
<dd><p>Package:LISP |
| 80 |
</p> |
| 81 |
<p>Opens the file specified by FILENAME, which may be a string, a pathname, |
| 82 |
or a stream. Returns a stream for the open file. |
| 83 |
DIRECTION is :INPUT, :OUTPUT, :IO or :PROBE. |
| 84 |
ELEMENT-TYPE is STRING-CHAR, (UNSIGNED-BYTE n), |
| 85 |
UNSIGNED-BYTE, (SIGNED-BYTE n), SIGNED-BYTE, CHARACTER, BIT, (MOD n), or |
| 86 |
:DEFAULT. |
| 87 |
IF-EXISTS is :ERROR, :NEW-VERSION, :RENAME, |
| 88 |
:RENAME-AND-DELETE, :OVERWRITE, :APPEND, :SUPERSEDE, or NIL. |
| 89 |
IF-DOES-NOT-EXIST is :ERROR, :CREATE, or NIL. |
| 90 |
</p> |
| 91 |
<p>If FILENAME begins with a vertical pipe sign: ’|’ then the resulting |
| 92 |
stream is actually a one way pipe. It will be open for reading |
| 93 |
or writing depending on the direction given. The rest |
| 94 |
of FILENAME in this case is passed to the /bin/sh command. See |
| 95 |
the posix description of popen for more details. |
| 96 |
</p><div class="example"> |
| 97 |
<pre class="example">(setq pipe (open "| wc < /tmp/jim")) |
| 98 |
(format t "File has ~%d lines" (read pipe)) |
| 99 |
(close pipe) |
| 100 |
</pre></div> |
| 101 |
|
| 102 |
</dd></dl> |
| 103 |
|
| 104 |
<dl> |
| 105 |
<dt id="index-_002aPRINT_002dBASE_002a">Variable: <strong>*PRINT-BASE*</strong></dt> |
| 106 |
<dd><p>Package:LISP |
| 107 |
The radix in which the GCL printer prints integers and rationals. |
| 108 |
The value must be an integer from 2 to 36, inclusive. |
| 109 |
</p> |
| 110 |
|
| 111 |
</dd></dl> |
| 112 |
|
| 113 |
<dl> |
| 114 |
<dt id="index-MAKE_002dSTRING_002dINPUT_002dSTREAM">Function: <strong>MAKE-STRING-INPUT-STREAM</strong> <em>(string &optional (start 0) (end (length string)))</em></dt> |
| 115 |
<dd><p>Package:LISP |
| 116 |
</p> |
| 117 |
<p>Returns an input stream which will supply the characters of String between |
| 118 |
Start and End in order. |
| 119 |
</p> |
| 120 |
|
| 121 |
</dd></dl> |
| 122 |
|
| 123 |
<dl> |
| 124 |
<dt id="index-PPRINT">Function: <strong>PPRINT</strong> <em>(object &optional (stream *standard-output*))</em></dt> |
| 125 |
<dd><p>Package:LISP |
| 126 |
</p> |
| 127 |
<p>Pretty-prints OBJECT. Returns OBJECT. Equivalent to |
| 128 |
(WRITE :STREAM STREAM :PRETTY T) |
| 129 |
The SI:PRETTY-PRINT-FORMAT property N (which must be a non-negative integer) |
| 130 |
of a symbol SYMBOL controls the pretty-printing of form |
| 131 |
(SYMBOL f1 ... fN fN+1 ... fM) |
| 132 |
in such a way that the subforms fN+1, ..., fM are regarded as the ’body’ of |
| 133 |
the entire form. For instance, the property value of 2 is initially given |
| 134 |
to the symbol DO. |
| 135 |
</p> |
| 136 |
|
| 137 |
</dd></dl> |
| 138 |
|
| 139 |
<dl> |
| 140 |
<dt id="index-_002aREAD_002dDEFAULT_002dFLOAT_002dFORMAT_002a">Variable: <strong>*READ-DEFAULT-FLOAT-FORMAT*</strong></dt> |
| 141 |
<dd><p>Package:LISP |
| 142 |
The floating-point format the GCL reader uses when reading floating-point |
| 143 |
numbers that have no exponent marker or have e or E for an exponent marker. |
| 144 |
Must be one of SHORT-FLOAT, SINGLE-FLOAT, DOUBLE-FLOAT, and LONG-FLOAT. |
| 145 |
</p> |
| 146 |
|
| 147 |
</dd></dl> |
| 148 |
|
| 149 |
<dl> |
| 150 |
<dt id="index-READ_002dPRESERVING_002dWHITESPACE">Function: <strong>READ-PRESERVING-WHITESPACE</strong> <em>(&optional (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil))</em></dt> |
| 151 |
<dd><p>Package:LISP |
| 152 |
</p> |
| 153 |
<p>Reads an object from STREAM, preserving the whitespace that followed the |
| 154 |
object. |
| 155 |
</p> |
| 156 |
|
| 157 |
</dd></dl> |
| 158 |
|
| 159 |
<dl> |
| 160 |
<dt id="index-STREAMP">Function: <strong>STREAMP</strong> <em>(x)</em></dt> |
| 161 |
<dd><p>Package:LISP |
| 162 |
</p> |
| 163 |
<p>Returns T if X is a stream object; NIL otherwise. |
| 164 |
</p> |
| 165 |
|
| 166 |
</dd></dl> |
| 167 |
|
| 168 |
|
| 169 |
<dl> |
| 170 |
<dt id="index-SET_002dDISPATCH_002dMACRO_002dCHARACTER">Function: <strong>SET-DISPATCH-MACRO-CHARACTER</strong> <em>(disp-char sub-char function &optional (readtable *readtable*))</em></dt> |
| 171 |
<dd><p>Package:LISP |
| 172 |
</p> |
| 173 |
<p>Causes FUNCTION to be called when the DISP-CHAR followed by SUB-CHAR is |
| 174 |
read. |
| 175 |
</p> |
| 176 |
|
| 177 |
</dd></dl> |
| 178 |
|
| 179 |
<dl> |
| 180 |
<dt id="index-WITH_002dOUTPUT_002dTO_002dSTRING">Macro: <strong>WITH-OUTPUT-TO-STRING</strong></dt> |
| 181 |
<dd><p>Package:LISP |
| 182 |
</p> |
| 183 |
<p>Syntax: |
| 184 |
</p><div class="example"> |
| 185 |
<pre class="example">(with-output-to-string (var [string]) {decl}* {form}*) |
| 186 |
</pre></div> |
| 187 |
|
| 188 |
<p>Binds VAR to a string output stream that puts characters into STRING, which |
| 189 |
defaults to a new string. The stream is automatically closed on exit and |
| 190 |
the string is returned. |
| 191 |
</p> |
| 192 |
|
| 193 |
</dd></dl> |
| 194 |
|
| 195 |
<dl> |
| 196 |
<dt id="index-FILE_002dLENGTH">Function: <strong>FILE-LENGTH</strong> <em>(file-stream)</em></dt> |
| 197 |
<dd><p>Package:LISP |
| 198 |
</p> |
| 199 |
<p>Returns the length of the specified file stream. |
| 200 |
</p> |
| 201 |
|
| 202 |
</dd></dl> |
| 203 |
|
| 204 |
<dl> |
| 205 |
<dt id="index-_002aPRINT_002dCASE_002a">Variable: <strong>*PRINT-CASE*</strong></dt> |
| 206 |
<dd><p>Package:LISP |
| 207 |
The case in which the GCL printer should print ordinary symbols. |
| 208 |
The value must be one of the keywords :UPCASE, :DOWNCASE, and :CAPITALIZE. |
| 209 |
</p> |
| 210 |
|
| 211 |
</dd></dl> |
| 212 |
|
| 213 |
<dl> |
| 214 |
<dt id="index-PRINT">Function: <strong>PRINT</strong> <em>(object &optional (stream *standard-output*))</em></dt> |
| 215 |
<dd><p>Package:LISP |
| 216 |
</p> |
| 217 |
<p>Outputs a newline character, and then prints OBJECT in the mostly readable |
| 218 |
representation. Returns OBJECT. Equivalent to |
| 219 |
(PROGN (TERPRI STREAM) (WRITE OBJECT :STREAM STREAM :ESCAPE T)). |
| 220 |
</p> |
| 221 |
|
| 222 |
</dd></dl> |
| 223 |
|
| 224 |
<dl> |
| 225 |
<dt id="index-SET_002dMACRO_002dCHARACTER">Function: <strong>SET-MACRO-CHARACTER</strong> <em>(char function &optional (non-terminating-p nil) (readtable *readtable*))</em></dt> |
| 226 |
<dd><p>Package:LISP |
| 227 |
</p> |
| 228 |
<p>Causes CHAR to be a macro character that, when seen by READ, causes FUNCTION |
| 229 |
to be called. |
| 230 |
</p> |
| 231 |
|
| 232 |
</dd></dl> |
| 233 |
|
| 234 |
<dl> |
| 235 |
<dt id="index-FORCE_002dOUTPUT">Function: <strong>FORCE-OUTPUT</strong> <em>(&optional (stream *standard-output*))</em></dt> |
| 236 |
<dd><p>Package:LISP |
| 237 |
</p> |
| 238 |
<p>Attempts to force any buffered output to be sent. |
| 239 |
</p> |
| 240 |
|
| 241 |
</dd></dl> |
| 242 |
|
| 243 |
<dl> |
| 244 |
<dt id="index-_002aPRINT_002dARRAY_002a">Variable: <strong>*PRINT-ARRAY*</strong></dt> |
| 245 |
<dd><p>Package:LISP |
| 246 |
Whether the GCL printer should print array elements. |
| 247 |
</p> |
| 248 |
|
| 249 |
</dd></dl> |
| 250 |
|
| 251 |
<dl> |
| 252 |
<dt id="index-STREAM_002dELEMENT_002dTYPE">Function: <strong>STREAM-ELEMENT-TYPE</strong> <em>(stream)</em></dt> |
| 253 |
<dd><p>Package:LISP |
| 254 |
</p> |
| 255 |
<p>Returns a type specifier for the kind of object returned by STREAM. |
| 256 |
</p> |
| 257 |
|
| 258 |
</dd></dl> |
| 259 |
|
| 260 |
<dl> |
| 261 |
<dt id="index-WRITE_002dBYTE">Function: <strong>WRITE-BYTE</strong> <em>(integer stream)</em></dt> |
| 262 |
<dd><p>Package:LISP |
| 263 |
</p> |
| 264 |
<p>Outputs INTEGER to the binary stream STREAM. Returns INTEGER. |
| 265 |
</p> |
| 266 |
|
| 267 |
</dd></dl> |
| 268 |
|
| 269 |
<dl> |
| 270 |
<dt id="index-MAKE_002dCONCATENATED_002dSTREAM">Function: <strong>MAKE-CONCATENATED-STREAM</strong> <em>(&rest streams)</em></dt> |
| 271 |
<dd><p>Package:LISP |
| 272 |
</p> |
| 273 |
<p>Returns a stream which takes its input from each of the STREAMs in turn, |
| 274 |
going on to the next at end of stream. |
| 275 |
</p> |
| 276 |
|
| 277 |
</dd></dl> |
| 278 |
|
| 279 |
<dl> |
| 280 |
<dt id="index-PRIN1">Function: <strong>PRIN1</strong> <em>(object &optional (stream *standard-output*))</em></dt> |
| 281 |
<dd><p>Package:LISP |
| 282 |
</p> |
| 283 |
<p>Prints OBJECT in the mostly readable representation. Returns OBJECT. |
| 284 |
Equivalent to (WRITE OBJECT :STREAM STREAM :ESCAPE T). |
| 285 |
</p> |
| 286 |
|
| 287 |
</dd></dl> |
| 288 |
|
| 289 |
<dl> |
| 290 |
<dt id="index-PRINC">Function: <strong>PRINC</strong> <em>(object &optional (stream *standard-output*))</em></dt> |
| 291 |
<dd><p>Package:LISP |
| 292 |
</p> |
| 293 |
<p>Prints OBJECT without escape characters. Returns OBJECT. Equivalent to |
| 294 |
(WRITE OBJECT :STREAM STREAM :ESCAPE NIL). |
| 295 |
</p> |
| 296 |
|
| 297 |
</dd></dl> |
| 298 |
|
| 299 |
<dl> |
| 300 |
<dt id="index-CLEAR_002dOUTPUT">Function: <strong>CLEAR-OUTPUT</strong> <em>(&optional (stream *standard-output*))</em></dt> |
| 301 |
<dd><p>Package:LISP |
| 302 |
</p> |
| 303 |
<p>Clears the output stream STREAM. |
| 304 |
</p> |
| 305 |
|
| 306 |
</dd></dl> |
| 307 |
|
| 308 |
<dl> |
| 309 |
<dt id="index-TERPRI">Function: <strong>TERPRI</strong> <em>(&optional (stream *standard-output*))</em></dt> |
| 310 |
<dd><p>Package:LISP |
| 311 |
</p> |
| 312 |
<p>Outputs a newline character. |
| 313 |
</p> |
| 314 |
|
| 315 |
</dd></dl> |
| 316 |
|
| 317 |
<dl> |
| 318 |
<dt id="index-FINISH_002dOUTPUT">Function: <strong>FINISH-OUTPUT</strong> <em>(&optional (stream *standard-output*))</em></dt> |
| 319 |
<dd><p>Package:LISP |
| 320 |
</p> |
| 321 |
<p>Attempts to ensure that all output sent to STREAM has reached its destination, |
| 322 |
and only then returns. |
| 323 |
</p> |
| 324 |
|
| 325 |
</dd></dl> |
| 326 |
|
| 327 |
<dl> |
| 328 |
<dt id="index-WITH_002dOPEN_002dFILE">Macro: <strong>WITH-OPEN-FILE</strong></dt> |
| 329 |
<dd><p>Package:LISP |
| 330 |
</p> |
| 331 |
<p>Syntax: |
| 332 |
</p><div class="example"> |
| 333 |
<pre class="example">(with-open-file (stream filename {options}*) {decl}* {form}*) |
| 334 |
</pre></div> |
| 335 |
|
| 336 |
<p>Opens the file whose name is FILENAME, using OPTIONs, and binds the variable |
| 337 |
STREAM to a stream to/from the file. Then evaluates FORMs as a PROGN. |
| 338 |
The file is automatically closed on exit. |
| 339 |
</p> |
| 340 |
|
| 341 |
</dd></dl> |
| 342 |
|
| 343 |
<dl> |
| 344 |
<dt id="index-DO">Special Form: <strong>DO</strong></dt> |
| 345 |
<dd><p>Package:LISP |
| 346 |
</p> |
| 347 |
<p>Syntax: |
| 348 |
</p><div class="example"> |
| 349 |
<pre class="example">(do ({(var [init [step]])}*) (endtest {result}*) |
| 350 |
{decl}* {tag | statement}*) |
| 351 |
</pre></div> |
| 352 |
|
| 353 |
<p>Creates a NIL block, binds each VAR to the value of the corresponding INIT, |
| 354 |
and then executes STATEMENTs repeatedly until ENDTEST is satisfied. After |
| 355 |
each iteration, assigns to each VAR the value of the corresponding STEP. When |
| 356 |
ENDTEST is satisfied, evaluates RESULTs as a PROGN and returns the value(s) of |
| 357 |
the last RESULT (or NIL if no RESULTs are supplied). Performs variable |
| 358 |
bindings and assignments all at once, just like LET and PSETQ do. |
| 359 |
</p> |
| 360 |
|
| 361 |
</dd></dl> |
| 362 |
|
| 363 |
<dl> |
| 364 |
<dt id="index-READ_002dFROM_002dSTRING">Function: <strong>READ-FROM-STRING</strong> <em>(string &optional (eof-error-p t) (eof-value nil) &key (start 0) (end (length string)) (preserve-whitespace nil))</em></dt> |
| 365 |
<dd><p>Package:LISP |
| 366 |
</p> |
| 367 |
<p>Reads an object from STRING. |
| 368 |
</p> |
| 369 |
|
| 370 |
</dd></dl> |
| 371 |
|
| 372 |
<dl> |
| 373 |
<dt id="index-WRITE_002dSTRING">Function: <strong>WRITE-STRING</strong> <em>(string &optional (stream *standard-output*) &key (start 0) (end (length string)))</em></dt> |
| 374 |
<dd><p>Package:LISP |
| 375 |
</p> |
| 376 |
<p>Outputs STRING and returns it. |
| 377 |
</p> |
| 378 |
|
| 379 |
</dd></dl> |
| 380 |
|
| 381 |
<dl> |
| 382 |
<dt id="index-_002aPRINT_002dLEVEL_002a">Variable: <strong>*PRINT-LEVEL*</strong></dt> |
| 383 |
<dd><p>Package:LISP |
| 384 |
How many levels deep the GCL printer should print. Unlimited if NIL. |
| 385 |
</p> |
| 386 |
|
| 387 |
</dd></dl> |
| 388 |
|
| 389 |
<dl> |
| 390 |
<dt id="index-_002aPRINT_002dRADIX_002a">Variable: <strong>*PRINT-RADIX*</strong></dt> |
| 391 |
<dd><p>Package:LISP |
| 392 |
Whether the GCL printer should print the radix indicator when printing |
| 393 |
integers and rationals. |
| 394 |
</p> |
| 395 |
|
| 396 |
</dd></dl> |
| 397 |
|
| 398 |
<dl> |
| 399 |
<dt id="index-Y_002dOR_002dN_002dP">Function: <strong>Y-OR-N-P</strong> <em>(&optional (format-string nil) &rest args)</em></dt> |
| 400 |
<dd><p>Package:LISP |
| 401 |
</p> |
| 402 |
<p>Asks the user a question whose answer is either ’Y’ or ’N’. If FORMAT-STRING |
| 403 |
is non-NIL, then FRESH-LINE operation is performed, a message is printed as |
| 404 |
if FORMAT-STRING and ARGs were given to FORMAT, and then a prompt |
| 405 |
"(Y or N)" is printed. Otherwise, no prompt will appear. |
| 406 |
</p> |
| 407 |
|
| 408 |
</dd></dl> |
| 409 |
|
| 410 |
<dl> |
| 411 |
<dt id="index-MAKE_002dBROADCAST_002dSTREAM">Function: <strong>MAKE-BROADCAST-STREAM</strong> <em>(&rest streams)</em></dt> |
| 412 |
<dd><p>Package:LISP |
| 413 |
</p> |
| 414 |
<p>Returns an output stream which sends its output to all of the given streams. |
| 415 |
</p> |
| 416 |
|
| 417 |
</dd></dl> |
| 418 |
|
| 419 |
<dl> |
| 420 |
<dt id="index-READ_002dCHAR">Function: <strong>READ-CHAR</strong> <em>(&optional (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil))</em></dt> |
| 421 |
<dd><p>Package:LISP |
| 422 |
</p> |
| 423 |
<p>Reads a character from STREAM. |
| 424 |
</p> |
| 425 |
|
| 426 |
</dd></dl> |
| 427 |
|
| 428 |
<dl> |
| 429 |
<dt id="index-PEEK_002dCHAR">Function: <strong>PEEK-CHAR</strong> <em>(&optional (peek-type nil) (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil))</em></dt> |
| 430 |
<dd><p>Package:LISP |
| 431 |
</p> |
| 432 |
<p>Peeks at the next character in the input stream STREAM. |
| 433 |
</p> |
| 434 |
|
| 435 |
</dd></dl> |
| 436 |
|
| 437 |
<dl> |
| 438 |
<dt id="index-OUTPUT_002dSTREAM_002dP">Function: <strong>OUTPUT-STREAM-P</strong> <em>(stream)</em></dt> |
| 439 |
<dd><p>Package:LISP |
| 440 |
</p> |
| 441 |
<p>Returns non-nil if STREAM can handle output operations; NIL otherwise. |
| 442 |
</p> |
| 443 |
|
| 444 |
</dd></dl> |
| 445 |
|
| 446 |
<dl> |
| 447 |
<dt id="index-_002aQUERY_002dIO_002a">Variable: <strong>*QUERY-IO*</strong></dt> |
| 448 |
<dd><p>Package:LISP |
| 449 |
The query I/O stream. |
| 450 |
</p> |
| 451 |
|
| 452 |
</dd></dl> |
| 453 |
|
| 454 |
<dl> |
| 455 |
<dt id="index-_002aREAD_002dBASE_002a">Variable: <strong>*READ-BASE*</strong></dt> |
| 456 |
<dd><p>Package:LISP |
| 457 |
The radix that the GCL reader reads numbers in. |
| 458 |
</p> |
| 459 |
|
| 460 |
</dd></dl> |
| 461 |
|
| 462 |
<dl> |
| 463 |
<dt id="index-WITH_002dOPEN_002dSTREAM">Macro: <strong>WITH-OPEN-STREAM</strong></dt> |
| 464 |
<dd><p>Package:LISP |
| 465 |
</p> |
| 466 |
<p>Syntax: |
| 467 |
</p><div class="example"> |
| 468 |
<pre class="example">(with-open-stream (var stream) {decl}* {form}*) |
| 469 |
</pre></div> |
| 470 |
|
| 471 |
<p>Evaluates FORMs as a PROGN with VAR bound to the value of STREAM. The stream |
| 472 |
is automatically closed on exit. |
| 473 |
</p> |
| 474 |
|
| 475 |
</dd></dl> |
| 476 |
|
| 477 |
<dl> |
| 478 |
<dt id="index-WITH_002dINPUT_002dFROM_002dSTRING">Macro: <strong>WITH-INPUT-FROM-STRING</strong></dt> |
| 479 |
<dd><p>Package:LISP |
| 480 |
</p> |
| 481 |
<p>Syntax: |
| 482 |
</p><div class="example"> |
| 483 |
<pre class="example">(with-input-from-string (var string {keyword value}*) {decl}* |
| 484 |
{form}*) |
| 485 |
</pre></div> |
| 486 |
|
| 487 |
<p>Binds VAR to an input stream that returns characters from STRING and evaluates |
| 488 |
the FORMs. The stream is automatically closed on exit. Allowed keywords are |
| 489 |
:INDEX, :START, and :END. |
| 490 |
</p> |
| 491 |
|
| 492 |
</dd></dl> |
| 493 |
|
| 494 |
<dl> |
| 495 |
<dt id="index-CLEAR_002dINPUT">Function: <strong>CLEAR-INPUT</strong> <em>(&optional (stream *standard-input*))</em></dt> |
| 496 |
<dd><p>Package:LISP |
| 497 |
Clears the input |
| 498 |
stream STREAM. |
| 499 |
</p> |
| 500 |
|
| 501 |
</dd></dl> |
| 502 |
|
| 503 |
<dl> |
| 504 |
<dt id="index-_002aTERMINAL_002dIO_002a">Variable: <strong>*TERMINAL-IO*</strong></dt> |
| 505 |
<dd><p>Package:LISP |
| 506 |
The terminal I/O stream. |
| 507 |
</p> |
| 508 |
|
| 509 |
</dd></dl> |
| 510 |
|
| 511 |
<dl> |
| 512 |
<dt id="index-LISTEN">Function: <strong>LISTEN</strong> <em>(&optional (stream *standard-input*))</em></dt> |
| 513 |
<dd><p>Package:LISP |
| 514 |
</p> |
| 515 |
<p>Returns T if a character is available on STREAM; NIL otherwise. This function |
| 516 |
does not correctly work in some versions of GCL because of the lack of such |
| 517 |
mechanism in the underlying operating system. |
| 518 |
</p> |
| 519 |
|
| 520 |
</dd></dl> |
| 521 |
|
| 522 |
<dl> |
| 523 |
<dt id="index-MAKE_002dPATHNAME">Function: <strong>MAKE-PATHNAME</strong> <em>(&key (defaults (parse-namestring "" (pathname-host *default-pathname-defaults*))) (host (pathname-host defaults)) (device (pathname-device defaults)) (directory (pathname-directory defaults)) (name (pathname-name defaults)) (type (pathname-type defaults)) (version (pathname-version defaults)))</em></dt> |
| 524 |
<dd><p>Package:LISP |
| 525 |
</p> |
| 526 |
<p>Create a pathname from HOST, DEVICE, DIRECTORY, NAME, TYPE and VERSION. |
| 527 |
</p> |
| 528 |
|
| 529 |
</dd></dl> |
| 530 |
|
| 531 |
<dl> |
| 532 |
<dt id="index-PATHNAME_002dTYPE">Function: <strong>PATHNAME-TYPE</strong> <em>(pathname)</em></dt> |
| 533 |
<dd><p>Package:LISP |
| 534 |
</p> |
| 535 |
<p>Returns the type slot of PATHNAME. |
| 536 |
</p> |
| 537 |
|
| 538 |
</dd></dl> |
| 539 |
|
| 540 |
<dl> |
| 541 |
<dt id="index-_002aPRINT_002dGENSYM_002a">Variable: <strong>*PRINT-GENSYM*</strong></dt> |
| 542 |
<dd><p>Package:LISP |
| 543 |
Whether the GCL printer should prefix symbols with no home package |
| 544 |
with "#:". |
| 545 |
</p> |
| 546 |
|
| 547 |
</dd></dl> |
| 548 |
|
| 549 |
<dl> |
| 550 |
<dt id="index-READ_002dLINE">Function: <strong>READ-LINE</strong> <em>(&optional (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil))</em></dt> |
| 551 |
<dd><p>Package:LISP |
| 552 |
</p> |
| 553 |
<p>Returns a line of text read from STREAM as a string, discarding the newline |
| 554 |
character. |
| 555 |
</p> |
| 556 |
<p>Note that when using line at a time input under unix, |
| 557 |
input forms will always be followed by a #\newline. Thus if you |
| 558 |
do |
| 559 |
</p> |
| 560 |
<p>>(read-line) |
| 561 |
"" |
| 562 |
nil |
| 563 |
</p> |
| 564 |
<p>the empty string will be returned. After lisp reads the (read-line) |
| 565 |
it then invokes (read-line). This happens before it does anything |
| 566 |
else and so happens before the newline character immediately following |
| 567 |
(read-line) has been read. Thus read-line immediately encounters a |
| 568 |
#\newline and so returns the empty string. If there had been other |
| 569 |
characters before the #\newline it would have been different: |
| 570 |
</p> |
| 571 |
<p>>(read-line) how are you |
| 572 |
" how are you" |
| 573 |
nil |
| 574 |
</p> |
| 575 |
<p>If you want to throw away "" input, you can do that with |
| 576 |
the following: |
| 577 |
</p> |
| 578 |
<p>(sloop::sloop while (equal (setq input (read-line)) "")) |
| 579 |
</p> |
| 580 |
<p>You may also want to use character at a time input, but that |
| 581 |
makes input editing harder. |
| 582 |
nicolas% stty cbreak |
| 583 |
nicolas% gcl |
| 584 |
GCL (GNU Common Lisp) Version(1.1.2) Mon Jan 9 12:58:22 MET 1995 |
| 585 |
Licensed under GNU Public Library License |
| 586 |
Contains Enhancements by W. Schelter |
| 587 |
</p> |
| 588 |
<p>>(let ((ifilename nil)) |
| 589 |
(format t "~%Input file name: ") |
| 590 |
(setq ifilename (read-line))) |
| 591 |
Input file name: /tmp/myfile |
| 592 |
"/tmp/myfile" |
| 593 |
</p> |
| 594 |
<p>>(bye)Bye. |
| 595 |
</p> |
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
</dd></dl> |
| 600 |
|
| 601 |
<dl> |
| 602 |
<dt id="index-WRITE_002dTO_002dSTRING">Function: <strong>WRITE-TO-STRING</strong> <em>(object &key (escape *print-escape*) (radix *print-radix*) (base *print-base*) (circle *print-circle*) (pretty *print-pretty*) (level *print-level*) (length *print-length*) (case *print-case*) (array *print-array*) (gensym *print-gensym*))</em></dt> |
| 603 |
<dd><p>Package:LISP |
| 604 |
</p> |
| 605 |
<p>Returns as a string the printed representation of OBJECT in the specified |
| 606 |
mode. See the variable docs of *PRINT-...* for the mode. |
| 607 |
</p> |
| 608 |
|
| 609 |
</dd></dl> |
| 610 |
|
| 611 |
<dl> |
| 612 |
<dt id="index-PATHNAMEP">Function: <strong>PATHNAMEP</strong> <em>(x)</em></dt> |
| 613 |
<dd><p>Package:LISP |
| 614 |
</p> |
| 615 |
<p>Returns T if X is a pathname object; NIL otherwise. |
| 616 |
</p> |
| 617 |
|
| 618 |
</dd></dl> |
| 619 |
|
| 620 |
<dl> |
| 621 |
<dt id="index-READTABLEP">Function: <strong>READTABLEP</strong> <em>(x)</em></dt> |
| 622 |
<dd><p>Package:LISP |
| 623 |
</p> |
| 624 |
<p>Returns T if X is a readtable object; NIL otherwise. |
| 625 |
</p> |
| 626 |
|
| 627 |
</dd></dl> |
| 628 |
|
| 629 |
<dl> |
| 630 |
<dt id="index-READ">Function: <strong>READ</strong> <em>(&optional (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursivep nil))</em></dt> |
| 631 |
<dd><p>Package:LISP |
| 632 |
</p> |
| 633 |
<p>Reads in the next object from STREAM. |
| 634 |
</p> |
| 635 |
|
| 636 |
</dd></dl> |
| 637 |
|
| 638 |
<dl> |
| 639 |
<dt id="index-NAMESTRING">Function: <strong>NAMESTRING</strong> <em>(pathname)</em></dt> |
| 640 |
<dd><p>Package:LISP |
| 641 |
</p> |
| 642 |
<p>Returns the full form of PATHNAME as a string. |
| 643 |
</p> |
| 644 |
|
| 645 |
</dd></dl> |
| 646 |
|
| 647 |
<dl> |
| 648 |
<dt id="index-UNREAD_002dCHAR">Function: <strong>UNREAD-CHAR</strong> <em>(character &optional (stream *standard-input*))</em></dt> |
| 649 |
<dd><p>Package:LISP |
| 650 |
</p> |
| 651 |
<p>Puts CHARACTER back on the front of the input stream STREAM. |
| 652 |
</p> |
| 653 |
|
| 654 |
</dd></dl> |
| 655 |
|
| 656 |
<dl> |
| 657 |
<dt id="index-CLOSE">Function: <strong>CLOSE</strong> <em>(stream &key (abort nil))</em></dt> |
| 658 |
<dd><p>Package:LISP |
| 659 |
</p> |
| 660 |
<p>Closes STREAM. A non-NIL value of :ABORT indicates an abnormal termination. |
| 661 |
</p> |
| 662 |
|
| 663 |
</dd></dl> |
| 664 |
|
| 665 |
<dl> |
| 666 |
<dt id="index-_002aPRINT_002dLENGTH_002a">Variable: <strong>*PRINT-LENGTH*</strong></dt> |
| 667 |
<dd><p>Package:LISP |
| 668 |
How many elements the GCL printer should print at each level of nested data |
| 669 |
object. Unlimited if NIL. |
| 670 |
</p> |
| 671 |
|
| 672 |
</dd></dl> |
| 673 |
|
| 674 |
<dl> |
| 675 |
<dt id="index-SET_002dSYNTAX_002dFROM_002dCHAR">Function: <strong>SET-SYNTAX-FROM-CHAR</strong> <em>(to-char from-char &optional (to-readtable *readtable*) (from-readtable nil))</em></dt> |
| 676 |
<dd><p>Package:LISP |
| 677 |
</p> |
| 678 |
<p>Makes the syntax of TO-CHAR in TO-READTABLE be the same as the syntax of |
| 679 |
FROM-CHAR in FROM-READTABLE. |
| 680 |
</p> |
| 681 |
|
| 682 |
</dd></dl> |
| 683 |
|
| 684 |
<dl> |
| 685 |
<dt id="index-INPUT_002dSTREAM_002dP">Function: <strong>INPUT-STREAM-P</strong> <em>(stream)</em></dt> |
| 686 |
<dd><p>Package:LISP |
| 687 |
</p> |
| 688 |
<p>Returns non-NIL if STREAM can handle input operations; NIL otherwise. |
| 689 |
</p> |
| 690 |
|
| 691 |
</dd></dl> |
| 692 |
|
| 693 |
<dl> |
| 694 |
<dt id="index-PATHNAME">Function: <strong>PATHNAME</strong> <em>(x)</em></dt> |
| 695 |
<dd><p>Package:LISP |
| 696 |
</p> |
| 697 |
<p>Turns X into a pathname. X may be a string, symbol, stream, or pathname. |
| 698 |
</p> |
| 699 |
|
| 700 |
</dd></dl> |
| 701 |
|
| 702 |
<dl> |
| 703 |
<dt id="index-FILE_002dNAMESTRING">Function: <strong>FILE-NAMESTRING</strong> <em>(pathname)</em></dt> |
| 704 |
<dd><p>Package:LISP |
| 705 |
</p> |
| 706 |
<p>Returns the written representation of PATHNAME as a string. |
| 707 |
</p> |
| 708 |
|
| 709 |
</dd></dl> |
| 710 |
|
| 711 |
<dl> |
| 712 |
<dt id="index-MAKE_002dDISPATCH_002dMACRO_002dCHARACTER">Function: <strong>MAKE-DISPATCH-MACRO-CHARACTER</strong> <em>(char &optional (non-terminating-p nil) (readtable *readtable*))</em></dt> |
| 713 |
<dd><p>Package:LISP |
| 714 |
</p> |
| 715 |
<p>Causes the character CHAR to be a dispatching macro character in READTABLE. |
| 716 |
</p> |
| 717 |
|
| 718 |
</dd></dl> |
| 719 |
|
| 720 |
<dl> |
| 721 |
<dt id="index-_002aSTANDARD_002dOUTPUT_002a">Variable: <strong>*STANDARD-OUTPUT*</strong></dt> |
| 722 |
<dd><p>Package:LISP |
| 723 |
The default output stream used by the GCL printer. |
| 724 |
</p> |
| 725 |
|
| 726 |
</dd></dl> |
| 727 |
|
| 728 |
<dl> |
| 729 |
<dt id="index-MAKE_002dTWO_002dWAY_002dSTREAM">Function: <strong>MAKE-TWO-WAY-STREAM</strong> <em>(input-stream output-stream)</em></dt> |
| 730 |
<dd><p>Package:LISP |
| 731 |
</p> |
| 732 |
<p>Returns a bidirectional stream which gets its input from INPUT-STREAM and |
| 733 |
sends its output to OUTPUT-STREAM. |
| 734 |
</p> |
| 735 |
|
| 736 |
</dd></dl> |
| 737 |
|
| 738 |
<dl> |
| 739 |
<dt id="index-_002aPRINT_002dESCAPE_002a">Variable: <strong>*PRINT-ESCAPE*</strong></dt> |
| 740 |
<dd><p>Package:LISP |
| 741 |
Whether the GCL printer should put escape characters whenever appropriate. |
| 742 |
</p> |
| 743 |
|
| 744 |
</dd></dl> |
| 745 |
|
| 746 |
<dl> |
| 747 |
<dt id="index-COPY_002dREADTABLE">Function: <strong>COPY-READTABLE</strong> <em>(&optional (from-readtable *readtable*) (to-readtable nil))</em></dt> |
| 748 |
<dd><p>Package:LISP |
| 749 |
</p> |
| 750 |
<p>Returns a copy of the readtable FROM-READTABLE. If TO-READTABLE is non-NIL, |
| 751 |
then copies into TO-READTABLE. Otherwise, creates a new readtable. |
| 752 |
</p> |
| 753 |
|
| 754 |
</dd></dl> |
| 755 |
|
| 756 |
<dl> |
| 757 |
<dt id="index-DIRECTORY_002dNAMESTRING">Function: <strong>DIRECTORY-NAMESTRING</strong> <em>(pathname)</em></dt> |
| 758 |
<dd><p>Package:LISP |
| 759 |
</p> |
| 760 |
<p>Returns the directory part of PATHNAME as a string. |
| 761 |
</p> |
| 762 |
|
| 763 |
</dd></dl> |
| 764 |
|
| 765 |
<dl> |
| 766 |
<dt id="index-TRUENAME">Function: <strong>TRUENAME</strong> <em>(pathname)</em></dt> |
| 767 |
<dd><p>Package:LISP |
| 768 |
</p> |
| 769 |
<p>Returns the pathname for the actual file described by PATHNAME. |
| 770 |
</p> |
| 771 |
|
| 772 |
</dd></dl> |
| 773 |
|
| 774 |
<dl> |
| 775 |
<dt id="index-_002aREAD_002dSUPPRESS_002a">Variable: <strong>*READ-SUPPRESS*</strong></dt> |
| 776 |
<dd><p>Package:LISP |
| 777 |
When the value of this variable is NIL, the GCL reader operates normally. |
| 778 |
When it is non-NIL, then the reader parses input characters but much of what |
| 779 |
is read is not interpreted. |
| 780 |
</p> |
| 781 |
|
| 782 |
</dd></dl> |
| 783 |
|
| 784 |
<dl> |
| 785 |
<dt id="index-GET_002dDISPATCH_002dMACRO_002dCHARACTER">Function: <strong>GET-DISPATCH-MACRO-CHARACTER</strong> <em>(disp-char sub-char &optional (readtable *readtable*))</em></dt> |
| 786 |
<dd><p>Package:LISP |
| 787 |
</p> |
| 788 |
<p>Returns the macro-character function for SUB-CHAR under DISP-CHAR. |
| 789 |
</p> |
| 790 |
|
| 791 |
</dd></dl> |
| 792 |
|
| 793 |
<dl> |
| 794 |
<dt id="index-PATHNAME_002dDEVICE">Function: <strong>PATHNAME-DEVICE</strong> <em>(pathname)</em></dt> |
| 795 |
<dd><p>Package:LISP |
| 796 |
</p> |
| 797 |
<p>Returns the device slot of PATHNAME. |
| 798 |
</p> |
| 799 |
|
| 800 |
</dd></dl> |
| 801 |
|
| 802 |
<dl> |
| 803 |
<dt id="index-READ_002dCHAR_002dNO_002dHANG">Function: <strong>READ-CHAR-NO-HANG</strong> <em>(&optional (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursive-p nil))</em></dt> |
| 804 |
<dd><p>Package:LISP |
| 805 |
</p> |
| 806 |
<p>Returns the next character from STREAM if one is available; NIL otherwise. |
| 807 |
</p> |
| 808 |
|
| 809 |
</dd></dl> |
| 810 |
|
| 811 |
<dl> |
| 812 |
<dt id="index-FRESH_002dLINE">Function: <strong>FRESH-LINE</strong> <em>(&optional (stream *standard-output*))</em></dt> |
| 813 |
<dd><p>Package:LISP |
| 814 |
</p> |
| 815 |
<p>Outputs a newline if it is not positioned at the beginning of a line. Returns |
| 816 |
T if it output a newline; NIL otherwise. |
| 817 |
</p> |
| 818 |
|
| 819 |
</dd></dl> |
| 820 |
|
| 821 |
<dl> |
| 822 |
<dt id="index-WRITE_002dCHAR">Function: <strong>WRITE-CHAR</strong> <em>(char &optional (stream *standard-output*))</em></dt> |
| 823 |
<dd><p>Package:LISP |
| 824 |
</p> |
| 825 |
<p>Outputs CHAR and returns it. |
| 826 |
</p> |
| 827 |
|
| 828 |
</dd></dl> |
| 829 |
|
| 830 |
<dl> |
| 831 |
<dt id="index-PARSE_002dNAMESTRING">Function: <strong>PARSE-NAMESTRING</strong> <em>(thing &optional host (defaults *default-pathname-defaults*) &key (start 0) (end (length thing)) (junk-allowed nil))</em></dt> |
| 832 |
<dd><p>Package:LISP |
| 833 |
</p> |
| 834 |
<p>Parses a string representation of a pathname into a pathname. HOST |
| 835 |
is ignored. |
| 836 |
</p> |
| 837 |
|
| 838 |
</dd></dl> |
| 839 |
|
| 840 |
<dl> |
| 841 |
<dt id="index-PATHNAME_002dDIRECTORY">Function: <strong>PATHNAME-DIRECTORY</strong> <em>(pathname)</em></dt> |
| 842 |
<dd><p>Package:LISP |
| 843 |
</p> |
| 844 |
<p>Returns the directory slot of PATHNAME. |
| 845 |
</p> |
| 846 |
|
| 847 |
</dd></dl> |
| 848 |
|
| 849 |
<dl> |
| 850 |
<dt id="index-GET_002dMACRO_002dCHARACTER">Function: <strong>GET-MACRO-CHARACTER</strong> <em>(char &optional (readtable *readtable*))</em></dt> |
| 851 |
<dd><p>Package:LISP |
| 852 |
</p> |
| 853 |
<p>Returns the function associated with CHAR and, as a second value, returns |
| 854 |
the non-terminating-p flag. |
| 855 |
</p> |
| 856 |
|
| 857 |
</dd></dl> |
| 858 |
|
| 859 |
<dl> |
| 860 |
<dt id="index-FORMAT">Function: <strong>FORMAT</strong> <em>(destination control-string &rest arguments)</em></dt> |
| 861 |
<dd><p>Package:LISP |
| 862 |
</p> |
| 863 |
<p>Provides various facilities for formatting output. |
| 864 |
DESTINATION controls where the result will go. If DESTINATION is T, then |
| 865 |
the output is sent to the standard output stream. If it is NIL, then the |
| 866 |
output is returned in a string as the value of the call. Otherwise, |
| 867 |
DESTINATION must be a stream to which the output will be sent. |
| 868 |
</p> |
| 869 |
<p>CONTROL-STRING is a string to be output, possibly with embedded |
| 870 |
formatting directives, which are flagged with the escape character |
| 871 |
"~". Directives generally expand into additional text to be output, |
| 872 |
usually consuming one or more of ARGUMENTs in the process. |
| 873 |
</p> |
| 874 |
|
| 875 |
|
| 876 |
<p>A few useful directives are: |
| 877 |
</p><div class="example"> |
| 878 |
<pre class="example"> |
| 879 |
|
| 880 |
~A, ~nA, ~n@A Prints one argument as if by PRINC |
| 881 |
~S, ~nS, ~n@S Prints one argument as if by PRIN1 |
| 882 |
~D, ~B, ~O, ~X Prints one integer in decimal, binary, octal, and hexa |
| 883 |
~% Does TERPRI |
| 884 |
~& Does FRESH-LINE |
| 885 |
</pre></div> |
| 886 |
|
| 887 |
<p>where n is the minimal width of the field in which the object is printed. |
| 888 |
~nA and ~nS put padding spaces on the right; ~n@A and ~n@S put on the left. |
| 889 |
</p> |
| 890 |
<div class="example"> |
| 891 |
<pre class="example">~R is for printing numbers in various formats. |
| 892 |
|
| 893 |
~nR prints arg in radix n. |
| 894 |
~R prints arg as a cardinal english number: two |
| 895 |
~:R prints arg as an ordinal english number: third |
| 896 |
~@R prints arg as an a Roman Numeral: VII |
| 897 |
~:@R prints arg as an old Roman Numeral: IIII |
| 898 |
|
| 899 |
~C prints a character. |
| 900 |
~:C represents non printing characters by their pretty names,eg Space |
| 901 |
~@C uses the #\ syntax to allow the reader to read it. |
| 902 |
|
| 903 |
~F prints a floating point number arg. |
| 904 |
The full form is ~w,d,k,overflowchar,padcharF |
| 905 |
w represents the total width of the printed representation (variable if |
| 906 |
not present) |
| 907 |
d the number of fractional digits to display |
| 908 |
(format nil "~,2f" 10010.0314) --> "10010.03" |
| 909 |
k arg is multiplied by 10^k before printing it as a decimal number. |
| 910 |
overflowchar width w characters copies of the overflow character will |
| 911 |
be printed. eg(format t "X>~5,2,,'?F<X" 100.034) --> X>?????<X |
| 912 |
padchar is the character to pad with |
| 913 |
(format t "X>~10,2,1,'?,'bF<X" 100.03417) -->X>bbb1000.34<X |
| 914 |
@ makes + sign print if the arg is positive |
| 915 |
|
| 916 |
~@[print-if-true~] |
| 917 |
</pre></div> |
| 918 |
<p>if arg is not nil, then it is retained as an arg for further printing, |
| 919 |
otherwise it is used up |
| 920 |
</p> |
| 921 |
<div class="example"> |
| 922 |
<pre class="example"> (format nil "~@[x = ~d~]~a" nil 'bil) --> "BIL" |
| 923 |
(format nil "~@[x = ~d ~]~a" 8) --> "x = 8 BIL" |
| 924 |
</pre></div> |
| 925 |
|
| 926 |
|
| 927 |
</dd></dl> |
| 928 |
|
| 929 |
<dl> |
| 930 |
<dt id="index-PATHNAME_002dNAME">Function: <strong>PATHNAME-NAME</strong> <em>(pathname)</em></dt> |
| 931 |
<dd><p>Package:LISP |
| 932 |
</p> |
| 933 |
<p>Returns the name slot of PATHNAME. |
| 934 |
</p> |
| 935 |
|
| 936 |
</dd></dl> |
| 937 |
|
| 938 |
<dl> |
| 939 |
<dt id="index-MAKE_002dSTRING_002dOUTPUT_002dSTREAM">Function: <strong>MAKE-STRING-OUTPUT-STREAM</strong> <em>()</em></dt> |
| 940 |
<dd><p>Package:LISP |
| 941 |
</p> |
| 942 |
<p>Returns an output stream which will accumulate all output given it for |
| 943 |
the benefit of the function GET-OUTPUT-STREAM-STRING. |
| 944 |
</p> |
| 945 |
|
| 946 |
</dd></dl> |
| 947 |
|
| 948 |
<dl> |
| 949 |
<dt id="index-MAKE_002dSYNONYM_002dSTREAM">Function: <strong>MAKE-SYNONYM-STREAM</strong> <em>(symbol)</em></dt> |
| 950 |
<dd><p>Package:LISP |
| 951 |
</p> |
| 952 |
<p>Returns a stream which performs its operations on the stream which is the |
| 953 |
value of the dynamic variable named by SYMBOL. |
| 954 |
</p> |
| 955 |
|
| 956 |
</dd></dl> |
| 957 |
|
| 958 |
<dl> |
| 959 |
<dt id="index-_002aLOAD_002dVERBOSE_002a">Variable: <strong>*LOAD-VERBOSE*</strong></dt> |
| 960 |
<dd><p>Package:LISP |
| 961 |
The default for the VERBOSE argument to LOAD. |
| 962 |
</p> |
| 963 |
|
| 964 |
</dd></dl> |
| 965 |
|
| 966 |
<dl> |
| 967 |
<dt id="index-_002aPRINT_002dCIRCLE_002a">Variable: <strong>*PRINT-CIRCLE*</strong></dt> |
| 968 |
<dd><p>Package:LISP |
| 969 |
Whether the GCL printer should take care of circular lists. |
| 970 |
</p> |
| 971 |
|
| 972 |
</dd></dl> |
| 973 |
|
| 974 |
<dl> |
| 975 |
<dt id="index-_002aPRINT_002dPRETTY_002a">Variable: <strong>*PRINT-PRETTY*</strong></dt> |
| 976 |
<dd><p>Package:LISP |
| 977 |
Whether the GCL printer should pretty-print. See the function doc of PPRINT |
| 978 |
for more information about pretty-printing. |
| 979 |
</p> |
| 980 |
|
| 981 |
</dd></dl> |
| 982 |
|
| 983 |
<dl> |
| 984 |
<dt id="index-FILE_002dWRITE_002dDATE">Function: <strong>FILE-WRITE-DATE</strong> <em>(file)</em></dt> |
| 985 |
<dd><p>Package:LISP |
| 986 |
</p> |
| 987 |
<p>Returns the time at which the specified file is written, as an integer in |
| 988 |
universal time format. FILE may be a string or a stream. |
| 989 |
</p> |
| 990 |
|
| 991 |
</dd></dl> |
| 992 |
|
| 993 |
<dl> |
| 994 |
<dt id="index-PRIN1_002dTO_002dSTRING">Function: <strong>PRIN1-TO-STRING</strong> <em>(object)</em></dt> |
| 995 |
<dd><p>Package:LISP |
| 996 |
</p> |
| 997 |
<p>Returns as a string the printed representation of OBJECT in the mostly |
| 998 |
readable representation. |
| 999 |
Equivalent to (WRITE-TO-STRING OBJECT :ESCAPE T). |
| 1000 |
</p> |
| 1001 |
|
| 1002 |
</dd></dl> |
| 1003 |
|
| 1004 |
<dl> |
| 1005 |
<dt id="index-MERGE_002dPATHNAMES">Function: <strong>MERGE-PATHNAMES</strong> <em>(pathname &optional (defaults *default-pathname-defaults*) default-version)</em></dt> |
| 1006 |
<dd><p>Package:LISP |
| 1007 |
</p> |
| 1008 |
<p>Fills in unspecified slots of PATHNAME from DEFAULTS. DEFAULT-VERSION |
| 1009 |
is ignored in GCL. |
| 1010 |
</p> |
| 1011 |
|
| 1012 |
</dd></dl> |
| 1013 |
|
| 1014 |
<dl> |
| 1015 |
<dt id="index-READ_002dBYTE">Function: <strong>READ-BYTE</strong> <em>(stream &optional (eof-error-p t) (eof-value nil))</em></dt> |
| 1016 |
<dd><p>Package:LISP |
| 1017 |
</p> |
| 1018 |
<p>Reads the next byte from STREAM. |
| 1019 |
</p> |
| 1020 |
|
| 1021 |
</dd></dl> |
| 1022 |
|
| 1023 |
<dl> |
| 1024 |
<dt id="index-PRINC_002dTO_002dSTRING">Function: <strong>PRINC-TO-STRING</strong> <em>(object)</em></dt> |
| 1025 |
<dd><p>Package:LISP |
| 1026 |
</p> |
| 1027 |
<p>Returns as a string the printed representation of OBJECT without escape |
| 1028 |
characters. Equivalent to |
| 1029 |
(WRITE-TO-STRING OBJECT :ESCAPE NIL). |
| 1030 |
</p> |
| 1031 |
|
| 1032 |
</dd></dl> |
| 1033 |
|
| 1034 |
<dl> |
| 1035 |
<dt id="index-_002aSTANDARD_002dINPUT_002a">Variable: <strong>*STANDARD-INPUT*</strong></dt> |
| 1036 |
<dd><p>Package:LISP |
| 1037 |
The default input stream used by the GCL reader. |
| 1038 |
</p> |
| 1039 |
|
| 1040 |
</dd></dl> |
| 1041 |
|
| 1042 |
<dl> |
| 1043 |
<dt id="index-PROBE_002dFILE">Function: <strong>PROBE-FILE</strong> <em>(file)</em></dt> |
| 1044 |
<dd><p>Package:LISP |
| 1045 |
</p> |
| 1046 |
<p>Returns the truename of file if the file exists. |
| 1047 |
Returns NIL otherwise. |
| 1048 |
</p> |
| 1049 |
|
| 1050 |
</dd></dl> |
| 1051 |
|
| 1052 |
<dl> |
| 1053 |
<dt id="index-PATHNAME_002dVERSION">Function: <strong>PATHNAME-VERSION</strong> <em>(pathname)</em></dt> |
| 1054 |
<dd><p>Package:LISP |
| 1055 |
</p> |
| 1056 |
<p>Returns the version slot of PATHNAME. |
| 1057 |
</p> |
| 1058 |
|
| 1059 |
</dd></dl> |
| 1060 |
|
| 1061 |
<dl> |
| 1062 |
<dt id="index-WRITE_002dLINE">Function: <strong>WRITE-LINE</strong> <em>(string &optional (stream *standard-output*) &key (start 0) (end (length string)))</em></dt> |
| 1063 |
<dd><p>Package:LISP |
| 1064 |
</p> |
| 1065 |
<p>Outputs STRING and then outputs a newline character. Returns STRING. |
| 1066 |
</p> |
| 1067 |
|
| 1068 |
</dd></dl> |
| 1069 |
|
| 1070 |
<dl> |
| 1071 |
<dt id="index-WRITE">Function: <strong>WRITE</strong> <em>(object &key (stream *standard-output*) (escape *print-escape*) (radix *print-radix*) (base *print-base*) (circle *print-circle*) (pretty *print-pretty*) (level *print-level*) (length *print-length*) (case *print-case*) (array *print-array*) (gensym *print-gensym*))</em></dt> |
| 1072 |
<dd><p>Package:LISP |
| 1073 |
</p> |
| 1074 |
<p>Prints OBJECT in the specified mode. See the variable docs of *PRINT-...* |
| 1075 |
for the mode. |
| 1076 |
</p> |
| 1077 |
|
| 1078 |
</dd></dl> |
| 1079 |
|
| 1080 |
<dl> |
| 1081 |
<dt id="index-GET_002dOUTPUT_002dSTREAM_002dSTRING">Function: <strong>GET-OUTPUT-STREAM-STRING</strong> <em>(stream)</em></dt> |
| 1082 |
<dd><p>Package:LISP |
| 1083 |
</p> |
| 1084 |
<p>Returns a string of all the characters sent to STREAM made by |
| 1085 |
MAKE-STRING-OUTPUT-STREAM since the last call to this function. |
| 1086 |
</p> |
| 1087 |
|
| 1088 |
</dd></dl> |
| 1089 |
|
| 1090 |
<dl> |
| 1091 |
<dt id="index-READ_002dDELIMITED_002dLIST">Function: <strong>READ-DELIMITED-LIST</strong> <em>(char &optional (stream *standard-input*) (recursive-p nil))</em></dt> |
| 1092 |
<dd><p>Package:LISP |
| 1093 |
</p> |
| 1094 |
<p>Reads objects from STREAM until the next character after an object’s |
| 1095 |
representation is CHAR. Returns a list of the objects read. |
| 1096 |
</p> |
| 1097 |
|
| 1098 |
</dd></dl> |
| 1099 |
|
| 1100 |
<dl> |
| 1101 |
<dt id="index-READLINE_002dON">Function: <strong>READLINE-ON</strong> <em>()</em></dt> |
| 1102 |
<dd><p>Package:SI |
| 1103 |
</p> |
| 1104 |
<p>Begins readline command editing mode when possible. In addition to |
| 1105 |
the basic readline editing features, command word completion is |
| 1106 |
implemented according to the following scheme: |
| 1107 |
</p> |
| 1108 |
<p>[[pkg]:[:]]txt |
| 1109 |
</p> |
| 1110 |
<p>pkg – an optional package specifier. Defaults to the current |
| 1111 |
package. The symbols in this package and those in the packages in |
| 1112 |
this package’s use list will be searched. |
| 1113 |
</p> |
| 1114 |
<p>:[:] – an optional internal/external specifier. Defaults to |
| 1115 |
external. The keyword package is denoted by a single colon at the |
| 1116 |
beginning of the token. Only symbols of this type will be searched |
| 1117 |
for completion. |
| 1118 |
</p> |
| 1119 |
<p>txt – a string. Symbol names beginning with this string are |
| 1120 |
completed. The comparison is case insensitive. |
| 1121 |
</p> |
| 1122 |
|
| 1123 |
</dd></dl> |
| 1124 |
|
| 1125 |
<dl> |
| 1126 |
<dt id="index-READLINE_002dOFF">Function: <strong>READLINE-OFF</strong> <em>()</em></dt> |
| 1127 |
<dd><p>Package:SI |
| 1128 |
</p> |
| 1129 |
<p>Disables readline command editing mode. |
| 1130 |
</p> |
| 1131 |
</dd></dl> |
| 1132 |
|
| 1133 |
<dl> |
| 1134 |
<dt id="index-_002aREADLINE_002dPREFIX_002a">Variable: <strong>*READLINE-PREFIX*</strong></dt> |
| 1135 |
<dd><p>Package:SI |
| 1136 |
</p> |
| 1137 |
<p>A string implicitly prepended to input text for use in readline |
| 1138 |
command completion. If this string contains one or more colons, it is |
| 1139 |
used to specify the default package and internal/external setting for |
| 1140 |
searched symbols in the case that the supplied text itself contains no |
| 1141 |
explicit package specification. If this string contains characters |
| 1142 |
after the colon(s), or contains no colons at all, it is treated as a |
| 1143 |
symbol name prefix. In this case, the prefix is matched first, then |
| 1144 |
the supplied text, and the completion returned is relative to the |
| 1145 |
supplied text itself, i.e. contains no prefix. For example, the |
| 1146 |
setting “maxima::$” will complete input text “int” according to |
| 1147 |
the internal symbols in the maxima package of the form |
| 1148 |
“maxima::$int...”, and return suggestions to the user of the form |
| 1149 |
“int...”. |
| 1150 |
</p> |
| 1151 |
</dd></dl> |
| 1152 |
|
| 1153 |
|
| 1154 |
<hr> |
| 1155 |
<div class="header"> |
| 1156 |
<p> |
| 1157 |
Next: <a href="Special-Forms-and-Functions.html" accesskey="n" rel="next">Special Forms and Functions</a>, Previous: <a href="Lists.html" accesskey="p" rel="prev">Lists</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 1158 |
</div> |
| 1159 |
|
| 1160 |
|
| 1161 |
|
| 1162 |
</body> |
| 1163 |
</html> |