Fork me on GitHub
Yehonathan Sharvit07:08:09

I want to change the location of a namespace from model.entry to data.entry When I update the require expression of a ns that requires valid-entries? from model.entry to data.entry, CIDER complains

valid-entries? already refers to: #'mr-hankey.model.entry/valid-entries? 
I understand that the var is redefined. But this is exactly what I want.


This is a clojure error

Yehonathan Sharvit07:08:20

Is there a way in CIDER to reload a namespace from scratch?


This works if you are editing the name space file


@viebel what do you mean by reloading "from scratch"?

Yehonathan Sharvit07:08:32

@jumar I mean removing all the vars and load the new ones in order to prevent the “already refers” error


I don't think there's out of the box support for that. You need to (remove-ns *ns*) and reload the buffer. Or you can use tools.namespace/refresh (perhaps via cider-ns-refresh?)

Yehonathan Sharvit08:08:28

seems to work @jumar. Thanks


That's probably some nice and easy feature to add by the way


What feature? Rename ns and refresh it?


I think there's an unload-ns or something


I don’t think so. There’s undef-var, but I don’t recall anything about ns unloading.


I guess we can easily extend undef var to an entire namespace, though. 🙂