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
user=> (defn foo1 [_] "foo1") | |
#'user/foo1 | |
user=> (let [bang (with-meta 'bang {:const true})] (intern *ns* bang foo1)) | |
#'user/bang | |
user=> (bang 1) | |
"foo1" | |
user=> (def foo1 (let [x "foo1"] (fn [_] x))) | |
#'user/foo1 | |
user=> (let [bang (with-meta 'bang {:const true})] (intern *ns* bang foo1)) |
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)))) |