collect
for filters
Collect the stream and pass it to a block.
Signature
> collect {flags} (closure)
Flags
--keep-env, -
: let the block affect environment variables
Parameters
closure
: the closure to run once the stream is collected
Input/output types:
input | output |
---|---|
any | any |
Examples
Use the second value in the stream
> [1 2 3] | collect { |x| $x.1 }
2