One of the biggest selling points of Clojure as a language is interactive development. To partake in that you need what we call a "REPL." This lets you write code in one tab of your editor and test it out live in another.
Enough digital ink has been spilled on that subject that I am going to forgo a full guide on that process for the moment.
deps.edn
for nREPL
{...
:aliases {:nREPL
{:extra-deps
{nrepl/nrepl {:mvn/version "1.3.0"}}}}}
nREPL
lets you connect to a running Clojure program "remotely."
This can mean over the internet, but for local development it's just your machine.
Justfile
for running
nREPL
.
Use clojure -M:nREPL -m nrepl.cmdline
as the command. The
-M:nREPL
activates the alias and
-m nrepl.cmdline
launches the nREPL
.
help:
just --list
run:
clojure -M -m main
nrepl:
clojure -M:nREPL -m nrepl.cmdline
nREPL
from your editor.
The instructions for this vary based on your editor. For the Clojure VSCode plugin, the documentation is HERE. For IntelliJ it is HERE.
Your editor likely also has a way to start its own
nREPL
server. Feel free to use that if you like. The
important thing is that you are able to load code into a REPL as you
are making your program.