One off namespaces playing around with some clojure concepts.
Either self-directed or from reference books such as the 2nd Edition of The Joy of Clojure, Clojure for the Brave and True or The Clojure Cookbook.
Since these are one-off experiments, I mostly throw things in one namespace and interact with it from a CIDER repl in my Emacs, for example, for the Sudoku solver from Chapter 16 of The Joy of Clojure:
My current set of packages and colors is pretty much straight out of the Clojure for the Brave and True Emacs tutorial, as packaged by the author. Caveat Emptor (?)
Using CIDER means that I can edit my functions in a file in one buffer, and run them in another. Some things to note:
- Upon start, CIDER will load the dependencies in the namespace's
project.clj
. If you add new dependencies, you'll want toM-x cider-quit
and then callM-x cider-jack-in
from a file in the projet. I believeM-x cider-restart
should work as well - My workflow is usually: write or edit a function, run
C-c C-k
to compile the buffer (which saves the file, too) and then, if I'm not already there, runC-c M-n
to switch the REPL's context to my current namespace.M-p
is useful when going back to previous sexps, in case I've changed a function, and Paredit's slurp and barf help too (C-)
andC-}
, respectively). - I'm also introducing the concept of Rich Comments in my namespaces, as articulated in Stuart Halloway's "Running with Scissors".