Skip to content

Instantly share code, notes, and snippets.

@mthvedt
Created April 23, 2013 00:57
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 mthvedt/5439964 to your computer and use it in GitHub Desktop.
Save mthvedt/5439964 to your computer and use it in GitHub Desktop.
(defn gen-interleave [coll i->vals]
(loop [r [] coll2 coll i 0]
(if (contains? i->vals i)
(recur (conj r (get i->vals i)) coll2 (inc i))
(if (seq coll2)
(recur (conj r (first coll2)) (rest coll2) (inc i))
r))))
(defn gen-rpartial [f themap]
(fn [& args] (apply f (gen-interleave args themap))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment