Functional programming without feeling stupid, part 5: Project

In the last four installments of [Functional programming without feeling stupid][1] I’ve slowly built up a small utility called ucdump with [Clojure][2]. 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][3] 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:

  • I want ucdump to be a good Clojure citizen, so I’m going to put it in a namespace

    called com.coniferproductions.ucdump.

  • My [Git repository for ucdump][4] also contains the original Python version of the application, which is in <_project-root_>/python, and I want the Clojure version to live in <<em>project-root</em>>/clojure.

[]