Cool, I thought it must exist somewhere, but the 3 3 nil is,
although obviously enabling, strange for what I would think should be
default behavior. I'll just go ahead and use
(def in-smaller-lists #(partition %1 %1 nil %2))
Thanks for the tip.
On Sep 25, 8:24 pm, Jeff Valk jv-li...@tx.rr.com
I'm doing some file streaming with a lazy list and I ran into a
problem where I had to process a whole chunk at a time, so I wrote
this function. Just posting to see if I'm reinventing something or if
it might be a good addition to contrib.
(defn in-smaller-lists [the-list smaller-list-size
to contrib.
(defn in-smaller-lists [the-list smaller-list-size] ...
Example:
user= (in-smaller-lists (range 11) 3)
((0 1 2) (3 4 5) (6 7 8) (9 10))
How about:
user= (partition 3 3 nil (range 11))
((0 1 2) (3 4 5) (6 7 8) (9 10))
--~--~-~--~~~---~--~~
You