-
-
Save charles-dyfis-net/9a1fa25f9a7429b6def7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn repro-bug [ref] | |
(let [my-delay (delay | |
(cond | |
(nil? ref) :nil | |
(= :throw @ref) (throw+ "Exception") | |
:else @ref))] | |
(fn [] @my-delay))) | |
(def repro-bug-atom (atom :throw)) | |
(def repro-bug-inst (repro-bug repro-bug-atom)) | |
(repro-bug-inst) ;; => throws "Exception" correctly | |
(reset! repro-bug-atom "Value") | |
(repro-bug-inst) ;; => returns :nil, not nil or "Value" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment