Advertisement
Guest User

Untitled

a guest
Sep 5th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (fn f [pred v coll]
  2.    (lazy-seq (cond
  3.     (= 0 (count coll)) ()
  4.     (= 1 (count coll)) coll
  5.     (pred (first coll) (second coll))
  6.       (concat (list (first coll)) (list v)
  7.               (f pred v (rest coll)))
  8.     :else (concat  (list (first coll))
  9.                 (f pred v (rest coll))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement