genpipe()
import { genpipe } from "@fed1/jsos";
The genpipe
method combinator
executes all matching primary methods in such a way that the result of method
n
is used as the argument to method n + 1
. The result of the last method
is then returned.
You can basically think of this method combinator as a pipeline where each method is a machine that takes whatever is on the pipeline and returns either a modified version that thing or a different thing altogether.
Usage
genpipe(args, getNext, hasNext)
This function is not supposed to be used on its own, but you can supply it as
a value for the option combinator
when creating a new multimethod using
Generic
.
Please see method combinator for more info and to learn how to write one yourself.
Version History
Feature | Since version |
---|---|
genpipe() | 1.0 |
See also
- API: genprogn()
- API: genlist()
- API: genplus()
- API: genstd()
- Article: Method Combinators