3 ms·
> test suite Re-running an entire test suite every time I make a tiny change to the code isn't viable. > cider reloading If only it didn't take forever! I re
by catnaroek 10y ago
> test suite
Re-running an entire test suite every time I make a tiny change to the code isn't viable.
> cider reloading
If only it didn't take forever! I really like Clojure the language, but having to restart CIDER every time I want to make the REPL forget my old wrong definitions is killing me. Not resetting the REPL's state is also pretty bad: I might accidentally use an old definition that was supposed to be discarded. The difference in behavior between macros and normal code exacerbates this problem: when you redefine a function, all existing uses of the function now point to the new version; but when you redefine a macro, all existing code that was generated by macro expansion retains its old form. So reasoning about the effects of the old definitions still being there can get quite complicated. There ought to be some way to tell the REPL, in a single instruction: “Please forget that previous versions of my code ever existed. They're all wrong.”
- silentmars 10y agoRestarting is different from reloading. Take a look at `clojure.tools.namespace.repl/refresh` - which in recent versions of CIDER is triggered with `cider-refresh`. It does what you're asking - blows away all the loaded namespaces and re-compiles them from source, synching up the running code environment with what's in your source files.
- catnaroek 10y agoThank you very much!
- muhuk 10y agoAre you using com.jakemccrary/lein-test-refresh? Tests run really fast after the first time.
- catnaroek 10y agoNo, but thanks for the pointer. I'll try it.