Sliding window transducer, similar to partition(size, 1), but supports initially partially filled windows, if partial is set to true (default). Each emitted window is a shallow copy of the internal accumulation buffer.
remarks
If size implements {@link IDeref}, the window size will be re-evaluated for each new input and therefore can be used as mechanism to dynamically adjust the window size.
Sliding window transducer, similar to
partition(size, 1)
, but supports initially partially filled windows, ifpartial
is set to true (default). Each emitted window is a shallow copy of the internal accumulation buffer.If
size
implements {@link IDeref}, the window size will be re-evaluated for each new input and therefore can be used as mechanism to dynamically adjust the window size.[...window(3, range(5))] // [ [ 0 ], [ 0, 1 ], [ 0, 1, 2 ], [ 1, 2, 3 ], [ 2, 3, 4 ] ] [...window(3, false, range(5))] // [ [ 0, 1, 2 ], [ 1, 2, 3 ], [ 2, 3, 4 ] ]