I am trying to create dynamic code inside clojure. In the function below, the idea is that conditions for the macro (s) will be dynamically generated.
(defn matching-keys [rec match-feed keys]
(> (count (clojure.set/select #(and (for [k keys]
(= (% k) (rec k))))
(set match-feed)))
0))
So if it worked! then this code will generate (and) something like this when passing keys [:tag :attrs]:
(and (= (% :tag) (rec :tag))
(= (% :attrs) (rec :attrs)))
I started talking to various operators `` and~ `to try and get it to work, and now I'm confused. Any recommendations are appreciated.
Thank,
Colin
source
share