INPUT/OUTPUT FUNCTIONS
Note that when printing objects, printing is accomplished by sending the message :prin1 to the object.
READ AN EXPRESSION
(read [<stream> [<eofp> [<eof> [<rflag>]]]])
NOTE: there has been an incompatible change in arguments from prior versions.
- <stream> the input stream (default, or NIL, is *standard-input*, T is *terminal-io*)
- <eofp> When T, signal an error on end of file, when NIL return <eof> (default is T)
- <eof> the value to return on end of file (default is NIL)
- <rflag> recursive read flag. The value is ignored
- returns the expression read
MODIFY READ TABLE
(set-macro-character <ch> <fcn> [ T ])
defined in init.lsp
- <ch> character to define
- <fcn> function to bind to character (see page 15)
- T if TMACRO rather than NMACRO
EXAMINE READ TABLE
(get-macro-character <ch>)
defined in init.lsp
- <ch> character
- returns function bound to character
PRINT AN EXPRESSION ON A NEW LINE
(print <expr> [<stream>])
The expression is printed using prin1, then current line is terminated (Note: this is backwards from Common Lisp).
- <expr> the expression to be printed
- <stream> the output stream (default, or NIL, is *standard-output*, T is *terminal-io*)
- returns the expression
PRINT AN EXPRESSION
(prin1 <expr> [<stream>])
symbols, cons cells (without circularities), arrays, strings, numbers, and characters are printed in a format generally acceptable to the read function. Printing format can be affected by the global formatting variables: *print-level* and *print-length* for lists and arrays, *integer-format* for fixnums, *float-format* for flonums, *ratio-format* for ratios, and *print-case* and *readtable-case* for symbols.
- <expr> the expression to be printed
- <stream> the output stream (default, or NIL, is *standard-output*, T is *terminal-io*)
- returns the expression
PRINT AN EXPRESSION WITHOUT QUOTING
(princ <expr> [<stream>])
Like PRIN1 except symbols (including uninterned), strings, and characters are printed without using any quoting mechanisms.
- <expr> the expressions to be printed
- <stream> the output stream (default, or NIL, is *standard-output*, T is *terminal-io*)
- returns the expression
PRETTY PRINT AN EXPRESSION
(pprint <expr> [<stream>])
Uses prin1 for printing.
- <expr> the expressions to be printed
- <stream> the output stream (default, or NIL, is *standard-output*, T is *terminal-io*)
- returns the expression
TERMINATE THE CURRENT PRINT LINE
(terpri [<stream>])
- <stream> the output stream (default, or NIL, is *standard-output*, T is *terminal-io*)
- returns NIL
START A NEW LINE
(fresh-line [<stream>])
- <stream> the output stream (default, or NIL, is *standard-output*, T is *terminal-io*)
- returns t if a new list was started, NIL if already at the start of a line.
LENGTH OF PRINTED REPRESENTATION USING PRIN1
(flatsize <expr>)
- <expr> the expression
- returns the length
LENGTH OF PRINTED REPRESENTATION USING PRINC
(flatc <expr>)
- <expr> the expression
- returns the length
ASK A YES OR NO QUESTION
(y-or-n-p [<fmt> [<arg>...]])
(yes-or-no-p [<fmt> [<arg>...]])
defined in common.lsp. Uses *terminal-io* stream for interaction. y-or-n-p strives for a single character answer, using get-key if defined.
- <fmt> optional format string for question (see page 78)
- <arg> arguments, if any, for format string
- returns T for yes, NIL for no.
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker