factor/basis/delegate/protocols/protocols.factor

21 lines
648 B
Factor
Raw Normal View History

! Copyright (C) 2007 Daniel Ehrenberg
! See http://factorcode.org/license.txt for BSD license.
2009-04-07 00:32:21 -04:00
USING: delegate sequences.private sequences assocs io ;
IN: delegate.protocols
PROTOCOL: sequence-protocol
like new-sequence new-resizable nth nth-unsafe
set-nth set-nth-unsafe length set-length
lengthen ;
PROTOCOL: assoc-protocol
at* assoc-size >alist set-at assoc-clone-like
delete-at clear-assoc new-assoc assoc-like ;
2008-05-05 04:51:41 -04:00
PROTOCOL: input-stream-protocol
stream-read1 stream-read-unsafe stream-read-partial-unsafe
stream-readln stream-read-until stream-contents* ;
2008-05-05 04:51:41 -04:00
PROTOCOL: output-stream-protocol
stream-flush stream-write1 stream-write stream-nl ;