FuncStream:
Filter:

FuncStream : Stream : AbstractFunction : Object

Stream of a function
Source: Stream.sc

Description

FuncStream is one of the most basic ways to describe a stream: it has a function that is called for each next stream value.

It uses Function: -inEnvir to statically bind the function call to the environment in which the FuncStream was created.

Class Methods

FuncStream.new(nextFunc, resetFunc)

Return a new stream object.

Arguments:

nextFunc

The function that is called on each next

resetFunc

The function that is called on reset

Inherited class methods

Instance Methods

.next(inval)

Arguments:

inval

Return the next value by calling the function. inval is passed as an argument to the function.

.reset

Call the reset function, if defined.

.envir

.envir = value

Get or set the environment to which the function has been bound.

.nextFunc

.nextFunc = value

Get or set the function which is called on -next.

.resetFunc

.resetFunc = value

Get or set the function which is called on -reset.

Inherited instance methods

Examples