On Fri 2 May 2014 at 09:06:59AM -0700, Oskar Kvist wrote: > Hi! > > I'm using Vim, vim-fireplace, `lein repl`, and tools.namespace. > > When I run `(tools.namespace.repl/refresh)` from within vim via > fireplace, it usually (perhaps always) works the first time. Say > there is a simple error like a misspelled word. The second time I > try to run `(tools.namespace.repl/refresh)`, I get back the error > "nREPL: namespace not found". I don't know exactly what causes it. If > I search for it on the web, most hits are fireplace issues. But it > says "nREPL", and maybe "namespace not found" can have something to > do with tools.namespace unloading them while refreshing. If I quit > and restart `lein repl`, the error disappears the first time I do > `(tools.namespace.repl/refresh)`. But for the second error after the > restart, it comes back, i.e. the exact same thing happens as before, > only I have managed to fix one more error in my code.
Hi Oskar, ctnr/refresh is a good way to reboot the REPL's state without having to restart the process. To do this, it removes namespaces, then re-requires them in dependency order. If you have an error in one of your namespaces, that namespace and all namespaces that depend on it will no longer be available, so you will get "namespace not found". There is probably a way to change fireplace to deal with this situation, but for now you should be able to work around this by creating the namespace manually from a namespace that does exist, like the `user` ns: user=> (create-ns 'my.broken-ns) The namespace will still be broken, but you should now at least see compiler errors. HTH guns
pgpDW8xGdWbno.pgp
Description: PGP signature