Function related to partition that includes all elements?
clojure
Solution
You're looking for `partition-all`. Just replace it in your example:
user> (partition-all 3 (range 4))
((0 1 2) (3))
user> (partition-all 3 (range 5))
((0 1 2) (3 4))
Problem
This behavior of Clojure's `partition` function is not what I need: ``` user=> (partition 3 (range 3)) ((0 1 2)) user=> (partition 3 (range 4)) ((0 1 2)) user=> (partition 3 (range 5)) ((0 1 2)) user=> (partition 3 (range 6)) ((0 1 2) (3 4 5)) ``` I need the 'leftover' portions of the collection to be included, e.g.: ``` user=> (partition* 3 (range 4)) ((0 1 2) (3)) user=> (partition* 3 (range 5)) ((0 1 2) (3 4)) ``` Is there a standard library function that does what I want?