Clojure and Leiningen quickstart
28 Dec 2012Introduction
Clojure is the modern LISP. Clojure is an elegant, dynamic programming language that runs a-top the JVM. In today’s post, I’ll show you how to get started with Clojure & Leiningen.
Getting installed
I’ve written this article from the perspective of a Debian user. Translating these steps into your own native environments should be as easy as re-structuring the installation steps to target your package manager of choice. Installing Clojure & Leiningen was a simple as this:
You’re done. You should now have Clojure and Leiningen at your disposal.
Initial steps
You’ll want to kick the tires on this puppy, so from your bash prompt fire up the REPL environment and try a few commands:
Alright! Enough of this already. Let’s generate a project. Leiningen is a painless way to get started on your Clojure project. All you have to do, is issue the following commands and you’ve got a project ready to go:
Where projname
is the name of your project. For this test, I just called mine “myproj”. If you have a look inside the directory that Leiningen has just generated for you, you’ll see the following sub-directories:
This is a pretty neat-and-tidy layout, ready for you to start coding.
Bulding and running and cleaning, oh my!
Leiningen also makes it very easy to build, run and cleanup your project. Here’s how. From within your project directory:
Too easy.