Fork me on GitHub
#cider
<
2022-11-27
>
mister_m01:11:12

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.

mister_m01:11:29

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

mister_m01:11:02

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?

dpsutton01:11:43

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

dpsutton01:11:31

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

dpsutton01:11:00

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

jumar09:11:52

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

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

1