Skip to content

Instantly share code, notes, and snippets.

@refset
Last active July 7, 2021 10:54
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 refset/a7f86c8a3ad34aea5d20eac0b5720a28 to your computer and use it in GitHub Desktop.
Save refset/a7f86c8a3ad34aea5d20eac0b5720a28 to your computer and use it in GitHub Desktop.
inline-eval-pred.clj
(defn inline-clj-pred [f & args]
(apply (eval f) (vec args)))
;; testing the pred outside of a query
(inline-clj-pred
(fn [coll]
(map (fn [x] (dissoc x :user)) coll))
#{{:user "ken" :color "red"}})
;; => ({:color "red"})
;; example clause
[(foo/inline-clj-pred
'(fn [coll]
(map (fn [x] (dissoc x :user)) coll))
?input)
?output]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment