Skip to content

Instantly share code, notes, and snippets.

View edtsech's full-sized avatar
🕵️‍♂️

Eduard Tsech edtsech

🕵️‍♂️
  • Prague, Czech Republic
View GitHub Profile
(defn split-by
"Create from sequence (l) sequence of sequences with specified number of elemenets (c)
Example:
(split-by 2 [1 2 3 4 5 6 7])
=> '((1 2) (3 4) (5 6) (7))"
[c l]
(if (seq l)
(cons (take c l) (split-by c (drop c l)))))
(defn split-into-chunks