Closed viebel closed 6 years ago
You can create a function to do this for you in your user.clj
file.
Use hawk to watch the directory that you want: https://github.com/wkf/hawk Extra Credit: handle load time exceptions and format the errors nicely and print them out.
Extra Extra Credit: make a library out of it
keep in mind the exception formats are going to change in the next release of Clojure
Also look at tools.namespace https://github.com/clojure/tools.namespace
Thanks for the tip @bhauman.
I ended up writing this piece of code in my user.clj
:
(hawk/watch! [{:paths ["src/calculator"]
:handler (fn [ctx e]
(future
(repl/refresh)))}])
(repl/refresh)
not inside a future.
java.lang.IllegalStateException: Can't change/establish root binding of: *ns* with set
user.clj
that is common to all my clojure projects or should I simply replicate it to each one of my clojure projects?
rebel-readline
is awesome. Is there a way to auto reload a namespace every time a source file changes (without having to re-require the namespace)?