You can also capture the binding. This looks a little ugly, but it works: it grabs the binding eagerly, and returns a closure that dynamically binds it when the function is invoked.

(binding [*v* 2]
  (map (let [v *v*]
         (fn [n]
           (binding [*v* v]
             (f n))))
       [1 1 1]))

Obviously you wouldn't use it in this instance -- use doall, or better yet rewrite your function to not use dynamic bindings -- but for larger jobs it works fine.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to