with-bindings

added
1.1

ns
clojure.core

type
macro

(with-bindings binding-map & body)

Takes a map of Var/value pairs. Installs for the given Vars the associated
values as thread-local bindings. Then executes body. Pops the installed
bindings after body was evaluated. Returns the value of body.

                (def ^:dynamic x 1)
;;=> #'user/x

x
;;=> 1

(with-bindings {#'x 2}
   x)
;;=> 2