Skip to content

Instantly share code, notes, and snippets.

@bostonaholic
Last active September 9, 2016 02:40
Show Gist options
  • Save bostonaholic/453a8164b6f40b48bb73e86f24ca0135 to your computer and use it in GitHub Desktop.
Save bostonaholic/453a8164b6f40b48bb73e86f24ca0135 to your computer and use it in GitHub Desktop.
with-redefs gotcha
user=> (defn hello [] "hello")
#'user/hello
user=> (defn goodbye [] "goodbye")
#'user/goodbye
user=> (let [f hello]
         (with-redefs [hello goodbye]
           (f)))
"hello"
user=> (with-redefs [hello goodbye]
         (let [f hello]
           (f)))
"goodbye"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment