If I have a script that starts nrepl server. How can I run another process with bb -e that runs a function in the context of that nrepl instance?
I guess https://github.com/babashka/nrepl-client is the answer?
yup, that seems to be working.
👍
do you only need this to execute a function to initialize the repl?
if so, there's an option for that in the nrepl server
No, no, I really need to run a function while connecting to the existing nrepl instance.
I wrote my wayland compositor config in babashka. It initially does: (nrepl/start-server! {:port 7888})
Later, I need to run shit through my compositor's IPC, basically issuing bash commands. But what I want is to be able to execute my Clojure code. Of course I could just use bb -e bla-bla where "bla-bla" would require things and run them - no problem.
However, what If later I'll have to deal with some stateful things, so I thought, why not run thy shit while connecting to the existing REPL.