Fork me on GitHub
#cider
<
2022-09-16
>
OknoLombarda03:09:06

Hi. I'm working on a clj/cljs project right now and most of the time start both REPLs at the same time (cider-jack-in-clj&cljs), but clj REPL always starts in shadow.user namespace. Can I change it somehow? I mean, so that it automatically switches to other namespace on startup

macrobartfast07:09:42

Does anyone know of a way (cider or not) to apply a function to the result of the function under the pointer on the fly without changing the code? For instance, if one wanted to count the number of elements in the vector returned by a function without having to surround the function in question with (count <the function>)? I’m thinking of a shortcut that would prompt for a command in the minibuffer and apply it to the result. I often surround a function with another function just to apply it once then delete it and I’d like to avoid the typing. Forgive me if this is not clear.

magnars08:09:34

When you say function, do you mean a function invocation that you've already typed out?

magnars08:09:10

If you've invoked a function, and would then quickly like a count of the last result you could use C-c M-: which gives you a clojure prompt, and type (count *1)

macrobartfast19:09:24

That’s what I meant (a function invocation that you’ve already typed out)… I’m thrilled there’s a route to this… currently C-c M-: seems bound to cider-read-and-eval (looking at the binding reveals C-c M-: runs the command cider-read-and-eval )… do you know which cider command your binding invokes?

macrobartfast19:09:12

oh wait… disregard my last comment… stand by.

macrobartfast19:09:30

It works! Thank you so much!

macrobartfast19:09:47

cider-read-and-eval, of course, is what you were suggesting.

magnars10:09:12

Indeed. I'm glad it was what you were looking for 🙂