Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (fn f [pred v coll]
- (lazy-seq (cond
- (= 0 (count coll)) ()
- (= 1 (count coll)) coll
- (pred (first coll) (second coll))
- (concat (list (first coll)) (list v)
- (f pred v (rest coll)))
- :else (concat (list (first coll))
- (f pred v (rest coll))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement