In the last four installments of [Functional programming without feeling stupid] I’ve slowly built up a small utility called
ucdump with [Clojure]. Experimentiing and developing with the Clojure REPL is fun, but now it’s time to give some structure to the utility. I’ll package it up as a [Leiningen] project and create a standalone JAR for executing with the Java runtime.
Creating a new project with Leiningen
You can use Leiningen to create a skeleton project quickly. In my project’s root directory, I’ll say:
Leiningen will respond with:
The result is a directory called ucdump, which contains:
For now I’m are most interested in the project file,
project.clj, which is actually a Clojure source file, and the
src directory, which is intended for the app’s actual source files.
Leiningen creates a directory called
src/ucdump and seeds it with a
core.clj file, but that’s not what actually what I want, for two reasons:
ucdumpto be a good Clojure citizen, so I’m going to put it in a namespace
My [Git repository for
ucdump] also contains the original Python version of the application, which is in <_project-root_>/python, and I want the Clojure version to live in