Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defn contextual-eval [ctx expr] ;; from Joy of clojure
(eval
`(let ~(vec (mapcat #(list % `('~ctx '~%)) (keys ctx)))
~expr)))
(defn contextual-eval ;; alternative
[ctx expr]
(eval
`(let ~(vec (apply concat ctx))
~expr)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.