Fork me on GitHub

what command do I need to execute to load all the definitions in a file so they are accessible in that file's namespace in the repl? I am a little confused about the difference between eval/load/require.


Side question, I have a defmulti where my dispatch function has changed , but it doesn't appear that C-x C-e is replacing the old one with the new changes. Do multimethods work differently here than other functions? With other functions after C-x C-e I see what looks like the "address" of the function returned like #'ns/fn-name but when I evaluate the defmutli I see nil


To get everything loaded up and usable in the repl it should only take doing C-c C-k, once I am already in that namespace?


defmulti acts like a defonce. redefining it does not redefine the dispatch function


to your original question, you just require the namespace like you would in a regular repl.


you should require or load the file. if you want to be in the namespace, then call (from memory, forget exactly what the function is) cider-set-ns


For redefining defmulti's dispatch fn you can use the trick with def:

(def my-multi nil)
(defmulti my-multi ...)
(defmethod my-multi ...)