Variables are immutable in Clojure. Therefore, you should not try to change the value foo, but instead create a new foo:
(def foo2 (+ foo 0.1))
... or, if in a loop, recur with a new value:
(loop [foo 5.0]
(when (< foo 9)
(recur (+ foo 0.1))))
... or, if foo is an atom, swap!it has a new meaning:
(def foo (atom 5.0))
(swap! foo (partial + 0.1))
I recommend that you start by reading the rationale for Clojure .
source
share