stream-nl ( stream -- )
Factor documentation > Factor handbook > Input and output > Streams > Stream protocol
Prev:stream-write ( data stream -- )
Next:stream-seekable? ( stream -- ? )


Vocabulary
io

Inputs and outputs
streaman output stream


Generic word contract
Writes a line terminator. If the stream does buffering, output may not be performed immediately; use stream-flush to force output.

Notes
Most code only works on one stream at a time and should instead use nl; see Default input and output streams.

Errors
Throws an error if the I/O operation fails.

Definition
IN: io

GENERIC: stream-nl ( stream -- )


Methods
USING: accessors io io.streams.256color.private ;

M: 256color stream-nl stream>> stream-nl ;


USING: curses curses.listener io kernel ;

M: curses-listener-stream stream-nl drop cnl ;


USING: accessors io io.streams.duplex kernel ;

M: duplex-stream stream-nl [ out>> ] call \ stream-nl execute ;


USING: io kernel ;

M: f stream-nl drop ; inline


USING: accessors io io.styles kernel ;

M: filter-writer stream-nl
[ stream>> ] call \ stream-nl execute ;


USING: html.streams html.streams.private io xml.data ;

M: html-writer stream-nl
[
T{ xml-chunk
{ seq V{ "" T{ tag { name ~name~ } } "" } }
}
] emit-html ;


USING: io kernel ;

M: output-stream stream-nl 10 swap stream-write1 ; inline


USING: io ui.gadgets.panes ui.gadgets.panes.private ;

M: pane-stream stream-nl [ pane-nl ] do-pane-stream ;


USING: accessors io kernel pdf.layout pdf.streams sequences ;

M: pdf-writer stream-nl <br> swap data>> push ;


USING: io io.streams.plain kernel ;

M: plain-writer stream-nl 10 swap stream-write1 ;