Subject: Re: format to nil?
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 16 Apr 2005 07:40:01 -0500
Newsgroups: comp.lang.lisp
Message-ID: <Auudneetc-M8mvzfRVn-tw@speakeasy.net>
Kent M Pitman  <pitman@nhplace.com> wrote:
+---------------
| For a bit-bucket of output going nowhere (i.e, like writing to
| /dev/null on unix/linux), use (make-broadcast-stream), that is,
| call that function with no arguments, meaning "broadcast to no one".  
| 
| On a related note, for an empty input stream, use
|  (make-concatenated-stream)
| meaning "concatenate no inputs".  You'll get an immediate
| eof when you try to read from this.  But it is trivially a stream.
| (I think this corresponds to reading from /dev/null, though I've
| got less experience doing that.)
+---------------

Very close, actually. And so if one *really* likes the /dev/null
analogy, one might like this:    ;-}  ;-}

    (make-two-way-stream (make-concatenated-stream)
			 (make-broadcast-stream))


-Rob

p.s. For some reason, CMUCL-19a barfs if you try to write
to such a stream, though writing to this one works fine:

    (make-two-way-stream (make-string-input-stream "")
			 (make-broadcast-stream))

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607