factor/extra/io/streams/null/null.factor

26 lines
815 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
! Copyright (C) 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
IN: io.streams.null
2008-02-09 22:34:42 -05:00
USING: kernel io io.timeouts continuations ;
2007-09-20 18:09:08 -04:00
TUPLE: null-stream ;
M: null-stream dispose drop ;
2008-02-09 22:34:42 -05:00
M: null-stream set-timeout drop ;
2007-09-20 18:09:08 -04:00
M: null-stream stream-readln drop f ;
M: null-stream stream-read1 drop f ;
M: null-stream stream-read-until 2drop f f ;
M: null-stream stream-read 2drop f ;
M: null-stream stream-write1 2drop ;
M: null-stream stream-write 2drop ;
M: null-stream stream-nl drop ;
M: null-stream stream-flush drop ;
M: null-stream stream-format 3drop ;
2007-09-25 20:54:05 -04:00
M: null-stream make-span-stream nip ;
M: null-stream make-block-stream nip ;
M: null-stream make-cell-stream nip ;
M: null-stream stream-write-table 3drop ;
2007-09-20 18:09:08 -04:00
: with-null-stream ( quot -- )
T{ null-stream } swap with-stream* ; inline