(def ^:dynamic foo 42)
(let [old foo]
(set! foo 45)
(println old foo)
(set! foo old)))
leaves the binding with the value 45 (same code as with binding+with-redefs). The problem is that the let binding is somehow inlining the reference to foo. For instance the println statement compiles to:
var inst_43089 = cljs.core.println.call(null,full.async.foo,full.async.foo);
I am currently having a look at ioc_macros.clj, but I couldn't find the problematic part yet. Any hints are helpful.