I sort of had to hack my way through this by trial and error.
It would be nice if:
the :paths value were standard boilerplate in deps.edn
the help file had some assistance about how to use your file from the REPL for beginners
there were some sort of standard defn for a function to view the names that were loaded from a file?
Between online books, the Clojure site, Google search, I think I can deal with most of the core language issue, but environment setup and usage can be rather tricky.
If you know a better way to go about loading and reloading a source file from within the REPL, please clue me in! ;)
I’m guessing the reason there are no instructions on using the REPL from the command line is that beginners aren’t really expected to do so when developing locally. The recommended approach is to use an editor or IDE with a built-in REPL plugin or extension. Two free options are:
Calva for VS Code
Cursive for IntelliJ
That said, here’s a typically workflow if you insist on not using the above tools:
Switch to project root directory and start the REPL with clj
Load the file with (load-file "src/annalyns_infiltration.clj")
Alternatively, you can require the namespace with (require 'annalyns-infiltration).
Check that the namespace is loaded with (find-ns 'annalyns-infiltration). You should see something like #object[clojure.lang.Namespace 0x77cb9cd1 "annalyns-infiltration"]
Write function can-fast-attack? in the editor, then reload the changes in the REPL:
Thank you for the reply, and thank you for the welcome.
Yeah, your instructions seem perfectly valid - I just don’t know some of the methods like (load-file "some/file/path/file.clj") yet. ;)
But I can see that works (and without any changes to deps.edn).
Sophisticated IDEs can be very nice, but when I am first learning a language, I just want to see simple stuff work in a simple environment: put some sort of source in a text file, then compile it or run it somehow (from within an REPL or otherwise).
“Clojure for the Brave and True” opens with an entire chapter on the wonders of EMACS. I wanted to learn and use EMACS on work systems 25 years ago, but getting sysadmins to install it was a major hassle. So, I’ve been using vi/vim for 30+ years.
I have used PyCharm and IntelliJ (basically same product), as well as VSCode a little bit. I may look into the other products you mention a bit later. ;)