Created
April 23, 2013 00:57
-
-
Save mthvedt/5439964 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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