Keep = 0 in ForEach throws away accumulator


I wanted to compare each value in a spread with the previous one, so I made a ForEach loop and remembered the first value with an accumulator. Since the first value does not have anything to compare with, I thought I’d set Keep to false for the first iteration. However, then the second iteration did not have the value of the first in the accumulator - it’s been thrown away too.

Like this:

Here I’d want both output slices to be one.
Does it make sense in any scenario to throw away the accumulated value too?

nice find! tracked.

Makes sense, keep output will not interfere anymore with accumulators. I’ve also added your patch to our tests. Fixed in upcoming build (>= efcfbd1d).

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.