factor/core/io/plain-stream.factor

21 lines
537 B
Factor
Raw Normal View History

2006-06-07 23:04:37 -04:00
! Copyright (C) 2005, 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2005-12-16 21:12:35 -05:00
IN: io
USING: generic assocs kernel math namespaces sequences
2006-06-07 23:04:37 -04:00
strings styles ;
2005-12-16 21:12:35 -05:00
TUPLE: plain-writer ;
C: plain-writer ( stream -- new-stream ) [ set-delegate ] keep ;
2005-12-16 21:12:35 -05:00
M: plain-writer stream-nl CHAR: \n swap stream-write1 ;
M: plain-writer stream-format
highlight rot at [ >r >upper r> ] when stream-write ;
M: plain-writer with-nested-stream
nip swap with-stream* ;
M: plain-writer with-stream-style
(with-stream-style) ;