2017-09-29

(sph stream)

srfi-41 stream helpers.

library description

re-exports (srfi srfi-41)

import name

(sph stream)

exports

define-stream

syntax

signature

(name . formal) body0 body1 ...

file->stream

procedure

signature

path read [close] ->

list->stream

procedure

signature

objs ->

port->buffered-octet-stream

procedure

signature

port buffer-size ->

port integer -> stream

description

creates stream that produces bytevectors of length buffer-size filled with data/octets read from port

port->delimited-stream

procedure

signature

delimiters-string port [handle-delim] ->

string port [symbol:read-delimited-handle-delim] -> stream

port->line-stream

procedure

signature

port ->

port -> stream -> string ...

description

create a stream that produces lines as strings read from port

port->stream

procedure

signature

port read [close] ->

any procedure:{any -> any/eof-object} [procedure] -> stream

description

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

stream

syntax

stream->list

procedure

signature

strm ->

stream-any

procedure

signature

proc stream ->

procedure stream -> boolean/any

stream-append

procedure

signature

strms ... ->

stream-car

procedure

signature

strm ->

stream-cdr

procedure

signature

strm ->

stream-concat

procedure

signature

strms ->

stream-cons

syntax

signature

obj strm

stream-constant

procedure

signature

->

stream-deduplicate

procedure

signature

a [set-create] ->

stream [procedure] ->

description

returns each distinct value only once.

set-create is a set-creation procedure from (sph set)

stream-drop

procedure

signature

n strm ->

stream-drop-while

procedure

signature

pred? strm ->

stream-each

procedure

signature

proc strm ->

stream-filter

procedure

signature

pred? strm ->

stream-first

procedure

signature

strm ->

stream-first-or-null

procedure

signature

a ->

stream -> any/list

stream-fold

procedure

signature

proc base strm ->

stream-fold-right-multiple

procedure

signature

proc a r ... ->

description

procedure stream any:state ...

stream-for-each

procedure

signature

proc strm ->

stream-from

procedure

signature

first [step] ->

stream-iterate

procedure

signature

proc base ->

stream-lambda

syntax

signature

formals body0 body1 ...

stream-length

procedure

signature

strm ->

stream-let

syntax

signature

tag ((name val) ...) body1 body2 ...

stream-map

procedure

signature

proc strm ->

stream-match

syntax

stream-null

variable

stream-null?

procedure

signature

obj ->

stream-of

syntax

signature

expr rest ...

stream-page

procedure

signature

a entry-count number lookahead c ->

stream integer integer integer procedure:{stream boolean:last-page? -> any} -> any

description

pass a stream of "entry-count" elements at an offset of (* number entry-count),

eventually including "lookahead" number of elements if they are the last elements,

and a boolean indicating if it is the last page to continuation procedure "c"

stream-pair?

procedure

signature

obj ->

stream-range

procedure

signature

first past [step] ->

stream-ref

procedure

signature

strm n ->

stream-reverse

procedure

signature

strm ->

stream-scan

procedure

signature

proc base strm ->

stream-tail

procedure

signature

strm ->

stream-take

procedure

signature

n strm ->

stream-take-while

procedure

signature

pred? strm ->

stream-unfold

procedure

signature

mapper pred? generator base ->

stream-unfolds

procedure

signature

gen seed ->

stream-zip

procedure

signature

strm rest ... ->

stream?

procedure

signature

obj ->


tags: guile documentation library scheme sph-lib computer sph-stream stream