-
-
Notifications
You must be signed in to change notification settings - Fork 108
Quick start: Clojure (babashka)
Conjure supports Babashka evaluation over the native nREPL support via the Clojure client. Some parts of Conjure’s Clojure support won’t work with it since it’s not Clojure on the JVM but it’s good enough!
This is actually optional as of this commit, Conjure will automatically start Babashka for you and connect to it whenever you open a Clojure file and it can’t find an existing nREPL to connect to. Babashka is the default evaluation environment for all Clojure buffers. A .nrepl-port file will automatically be created for you (and deleted after the editing session).
Starting a bb
nREPL server is as simple as providing a command line argument. It won’t pick a port for you or spit it out into a .nrepl-port
file for Conjure to hook into automatically though. We can use the following to pick a port and place it in a file for Conjure to read.
echo "5678" > .nrepl-port
bb --nrepl-server 5678
You should now be able to open a babashka script (regular Clojure files really!) and evaluate as you normally would. You even get completions!
If you’re unsure how to evaluate things with Conjure, please refer to :help conjure
, :help conjure-client-clojure-nrepl
and :ConjureSchool
(an interactive tutorial).