STRING STREAM FUNCTIONS
These functions operate on unnamed streams. An unnamed output stream collects characters sent to it when it is used as the destination of any output function. The functions 'get-output-stream' string and list return a sting or list of the characters.
An unnamed input stream is setup with the 'make-string-input-stream' function and returns each character of the string when it is used as the source of any input function.
Note that there is no difference between unnamed input and output streams. Unnamed input streams may be written to by output functions, in which case the characters are appended to the tail end of the stream. Unnamed output streams may also be (destructively) read by any input function as well as the get-output-stream functions.
(make-string-input-stream <str> [<start> [<end>]])
- <str> the string
- <start> the starting offset
- <end> the ending offset + 1 or NIL for end of string
- returns an unnamed stream that reads from the string
(make-string-output-stream)
- returns an unnamed output stream
(get-output-stream-string <stream>)
The output stream is emptied by this function
- <stream> the output stream
- returns the output so far as a string
(get-output-stream-list <stream>)
The output stream is emptied by this function
- <stream> the output stream
- returns the output so far as a list
(with-input-from-string (<var> <str> &key :start :end :index) [<expr>...])
Defined in common.lsp as a macro
- <var> symbol that stream is bound to during execution of expressions (quoted)
- <str> the string
- :start starting offset into string (default 0)
- :end ending offset + 1 (default, or NIL, is end of string)
- :index setf place form which gets final index into string after last expression is executed (quoted)
- <expr> expressions to evaluate (implicit progn)
- returns the value of the last <expr>
(with-output-to-string (<var>) [<expr>...])
Defined in common.lsp as a macro
- <var> symbol that stream is bound to during execution of expressions (quoted)
- <expr> expressions to evaluate (implicit progn)
- returns contents of stream, as a string
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker