Skip to content

Instantly share code, notes, and snippets.

@lenstr
Created January 28, 2012 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lenstr/1691934 to your computer and use it in GitHub Desktop.
Save lenstr/1691934 to your computer and use it in GitHub Desktop.
(defn map-ext [f x & xs]
(let [colls (cons x xs)
res (apply map f colls)
next (filter not-empty (map #(drop (count res) %) colls))]
(if (empty? next) res
(lazy-seq (concat res (apply map-ext f next))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment