I'm experimenting using Clojure's socket repl in some project that use lein
.
I added this my lein profile:
:jvm-opts ["-Dclojure.server.repl={:port 0 :accept clojure.core.server/repl}"]
I'm using port 0 because if I use some hardcoded value, I won't be able to run multiple socket repls, as they would point to the same port.
This works, but it's still a bit painful because I need to manually get the port number (see the code below) and use that for connecting with Emacs.
(.getLocalPort (get-in @#'clojure.core.server/servers ["repl" :socket]))
I'm wondering if there's any way of automating this.