Skip to content

Instantly share code, notes, and snippets.

@oranenj
Created August 6, 2009 08:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save oranenj/163202 to your computer and use it in GitHub Desktop.
(defn foo [f pred as bs]
((fn gen [[a & as] [b & bs :as all-bs]]
(when a
(let [p (pred a)]
(lazy-seq
(cons (if p
(f a b) a)
(gen as (if p bs all-bs)))))))
as bs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment