]> gitweb.factorcode.org Git - factor.git/blob - basis/delegate/protocols/protocols.factor
io: Make stream-contents call stream-contents* and do the disposal in the top-level...
[factor.git] / basis / delegate / protocols / protocols.factor
1 ! Copyright (C) 2007 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: delegate sequences.private sequences assocs io ;
4 IN: delegate.protocols
5
6 PROTOCOL: sequence-protocol
7 like new-sequence new-resizable nth nth-unsafe
8 set-nth set-nth-unsafe length set-length
9 lengthen ;
10
11 PROTOCOL: assoc-protocol
12 at* assoc-size >alist set-at assoc-clone-like
13 delete-at clear-assoc new-assoc assoc-like ;
14
15 PROTOCOL: input-stream-protocol
16 stream-read1 stream-read-unsafe stream-read-partial-unsafe
17 stream-readln stream-read-until stream-contents* ;
18
19 PROTOCOL: output-stream-protocol
20 stream-flush stream-write1 stream-write stream-nl ;