XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

make-string-output-stream


Type:   -   function (subr)
Source:   -   xlfio.c

Syntax

(make-string-output-stream)
returns - an unnamed output stream

Description

The 'make-string-output-stream' function creates and returns an unnamed output stream. The stream can then be used as any other stream object.

Examples

(make-string-output-stream)             ; returns #<Unnamed-Stream: #2d9c0>

(setq out (make-string-output-stream))  ; returns #<Unnamed-Stream: #2d95c>

(format out "fee fi fo fum ")           ; \
(format out "I smell the blood of ")    ;  fill up output stream
(format out "Elmer Fudd")               ; /
(get-output-stream-string out)          ; returns "fee fi fo fum I smell the blood of Elmer Fudd"

(format out "~%now what")               ; add more to output stream
(get-output-stream-string out)          ; returns "\nnow what"

(format out "hello")                    ; add more to output stream
(read out)                              ; returns HELLO

See the make-string-output-stream function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next