chunk together consecutive items in collection that abide by given predicate
Parameters
chunk collection :integer :string :literal :dictionary :object :inline :block :range
params :null :literal :block
condition :block :bytecode
Attributes
with |
:literal |
use given index |
value |
:any |
also include condition values |
Returns
Examples
copy
chunk [1 1 2 2 3 22 3 5 5 7 9 2 5] => even?
copy
chunk.value [1 1 2 2 3 22 3 5 5 7 9 2 5] 'x [ odd? x ]
copy
chunk.with:'i ["one" "two" "three" "four" "five" "six"] [] -> i < 4
copy
chunk [1 7 5 4 3 6 8 2] [x y]-> even? x+y
Related