Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

get-output-stream-string

get-output-stream-string

type: function (subr) 
location: built-in
source file: xlfio.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(get-output-stream-string <source> )
        <source>        -       an output stream expression

DESCRIPTION

The GET-OUTPUT-STREAM-STRING function empties the specified <source> and returns this data as a single string. The output stream is emptied by this operation.

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"
(get-output-stream-string out)          ; returns ""
(format out "hello")                    ; add more to output stream
(read out)                              ; returns HELLO


Go to the first, previous, next, last section, table of contents.