From: Nikodemus S. <nik...@ra...> - 2008-12-12 08:52:11
|
On Fri, Dec 12, 2008 at 9:48 AM, Didier Verna <did...@gm...> wrote: > But I'm not using Slime. I'm compiling a standalone application > (besides, *standard-output* /is/ a synonym stream in SBCL). Something like this may be of use: (defgeneric stream-file-stream (stream &optional direction)) (defmethod stream-file-stream ((stream file-stream) &optional direction) (declare (ignore direction)) stream) (defmethod stream-file-stream ((stream synonym-stream) &optional direction) (declare (ignore direction)) (stream-file-stream (symbol-value (synonym-stream-symbol stream)))) (defmethod stream-file-stream ((stream two-way-stream) &optional direction) (stream-file-stream (case direction (:input (two-way-stream-input-stream stream)) (:output (two-way-stream-output-stream stream)) (otherwise (error "Cannot handle a TWO-WAY-STREAM without a valid direction: ~S" direction))))) Cheers, -- Nikodemus |