ClojureDocs

导航

名称空间

push-thread-bindings

clojure.core

1.1 版中新增 (源代码)
  • (push-thread-bindings bindings)
WARNING: This is a low-level function. Prefer high-level macros like
binding where ever possible.
 Takes a map of Var/value pairs. Binds each Var to the associated value for
the current thread. Each call *MUST* be accompanied by a matching call to
pop-thread-bindings wrapped in a try-finally!

    (push-thread-bindings bindings)
    (try
      ...
      (finally
        (pop-thread-bindings)))