|
|
|
|
|
by joncampbelldev
3223 days ago
|
|
I think there may be some confusion here, immutability is about the stability of values (e.g. I have a string, list, map etc and I want to pass it to others, view its value, make changes without affecting the original value). Immutability is not the same as rebinding a name (in clojure at least) e.g. the following is perfectly valid (global and local binding of the same name repeatedly) (def a 1)
(def a 2)
(def a 3)
(println a)
=> 3
(let [a 4
a 5
a 6]
(println a))
=> 6
|
|