Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (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)))
Add Comment
Please, Sign In to add comment