Closed
Description
Hi,
I can't seem to get alter-var-root
to alter any variable's root binding.
To reproduce, create a variable and alter its value. Even though the update happens, the variables root value remains the same as before the update
> basilisp repl
basilisp.user=> (def abc 7)
#'basilisp.user/abc
basilisp.user=> (alter-var-root #'abc (fn [x] (println :current x) (inc x)))
:current 7
nil
basilisp.user=> abc
7
The same works in clojure as expected
> clj
Clojure 1.12.0
user=> (def abc 7)
#'user/abc
user=> (alter-var-root #'abc (fn [x] (println :current x) (inc x)))
:current 7
8
user=> abc
8
Thanks