(sph stream)

srfi-41 stream helpers

part of sph-lib

module name

(sph stream)

exported bindings

procedure: file->stream path read [close] ->
procedure: port->buffered-octet-stream port buffer-size ->
port integer -> stream
creates stream that produces bytevectors of length buffer-size filled with data/octets read from port
procedure: port->delimited-stream delimiters-string port [handle-delim] ->
string port [symbol:read-delimited-handle-delim] -> stream
procedure: port->line-stream port ->
port -> stream -> string ...
create a stream that reads lines from port
procedure: port->stream port read [close] ->
any procedure:{any -> any/eof-object} [procedure] -> stream
create a stream that calls (read port) until the result is the end-of-file object and then close port.
works with any type for port as long as read eventually returns an eof-object.
port->stream from srfi-41 does not support a custom reader
variable: sph-stream-description
procedure: stream-any proc stream ->
procedure stream -> boolean/any
procedure: stream-deduplicate a [set-create] ->
stream [procedure] ->
returns each distinct value only once.
set-create is a set-creation procedure from (sph set)
procedure: stream-each proc strm ->
procedure: stream-first strm ->
procedure: stream-first-or-null a ->
stream -> any/list
procedure: stream-fold-right-multiple proc a r ... ->
procedure stream any:state ...
procedure: stream-page a entry-count number lookahead c ->
procedure: stream-tail strm ->