Affects Version/s: None
Fix Version/s: Release 1.2
Steve Gilardi and I noticed some strange behaviour with local clearing in conjunction with delay:
(defn do-something [x]
(defn clear-locals [x]
(delay (try (do-something x)
(catch Exception e
(println "argument value:" x)))))
(force (clear-locals :argument))
;; => argument value: nil
It seems the locals are getting cleared a little too aggressively here. I did some digging to discover that delay is a thin wrapper around an fn, but using an fn in this context (rather than a delay) does not trigger the problem. Also I found that throwing an exception directly inside the try block (rather than in a function called from the try block) did not trigger it.
I was able to reproduce in the new branch, the master branch, and 1.0.0, so it's not related to the more recent locals-clearing changes.