A solution that is easy to understand would be using partition-by:
That seems will work. Let’s define it.
But if we integrate that with our countdown function and we run it:
It will get blocked because (iterate countdown initial-count) returns an infinite lazy-sequence and partition-by will evaluate every element in the next sequence. Which in this case is equivalent to an infinite loop.
Let’s demonstrate it through take-while+:
You can see how it is evaluating all the elements of the (range 5 -5 -1) sequence. I would expect to stop evaluating at 0 (the first element that is finished?).