I have this clojure file:
(ns foo.core)
(def bar 1)
And this project.clj:
(defproject foo "version"
:dependencies [[org.clojure/clojure "1.6.0"]]
:main foo.core)
I open a terminal and run lein repl. Then I change the value of bar OUTSIDE the repl.
(def bar 1)
to
(def bar 2)
I change this value on the editor and don't forget to save the file. Then I run the command in the repl (load-string "(clojure.tools.namespace.repl/refresh)") I type bar in the repl and still get 1 instead of 2. However if you just run (clojure.tools.namespace.repl/refresh) and then query the value of bar you get 2. Why is this so? Why is the function load-string breaking it?