Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn compart [pred coll]
- (loop [coll coll
- result []
- sub []]
- (if (seq coll)
- (let [item (first coll)]
- (if (pred item)
- (recur (rest coll) result (conj sub item))
- (recur (rest coll) (conj result sub) [])))
- (if (seq sub)
- (conj result sub)
- result))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement