How can I get clojure "def" to re-evaluate without using: reload?

How can I get clojure "def" for revaluation without using: reload?

+3
source share
2 answers
(def x 0)
x   ; => 0
(def x 1)
x   ; => 1

You cannot override var from another namespace, so you need to switch to that namespace with in-ns before defing again.

+5
source

You can also call load or load-file in repl.

(load-file "foo/bar.clj")
(load "foo/bar")
+2
source

Source: https://habr.com/ru/post/1780729/


All Articles