]> gitweb.factorcode.org Git - factor.git/blob - extra/io/streams/null/null.factor
Initial import
[factor.git] / extra / io / streams / null / null.factor
1 ! Copyright (C) 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 IN: io.streams.null
4 USING: kernel io ;
5
6 TUPLE: null-stream ;
7
8 M: null-stream stream-close drop ;
9 M: null-stream set-timeout 2drop ;
10 M: null-stream stream-readln drop f ;
11 M: null-stream stream-read1 drop f ;
12 M: null-stream stream-read-until 2drop f f ;
13 M: null-stream stream-read 2drop f ;
14 M: null-stream stream-write1 2drop ;
15 M: null-stream stream-write 2drop ;
16 M: null-stream stream-nl drop ;
17 M: null-stream stream-flush drop ;
18 M: null-stream stream-format 3drop ;
19 M: null-stream with-nested-stream rot drop with-stream* ;
20
21 : with-null-stream ( quot -- )
22     T{ null-stream } swap with-stream* ; inline