This is a short guide for getting familiar with Clojure programming language and its basic development tools. This article is targeted to the students at TAMK that participated the visiting lecture on Thu 29.11.2012. Please feel free to ask questions, if you have any problems setting up the Clojure development environment.
Let’s install Eclipse with Clojure support
- Download zipped Eclipse with Clojure support
- Unzip the package and start Eclipse by double-clicking eclipse.exe
- Choose a location for the workspace. It can be any directory and will contain the source files.
- Create a new Leiningen project by choosing File -> New -> Leiningen Project and give it a name like “testi” or anything. (Leiningen is a build tool built on top of Maven)
- Close the welcome screen and navigate to testi -> src -> testi -and open file core.clj by double clicking it.
- Edit the file as follows:
- Run code by clicking right mouse button -> Clojure -> Load File in REPL
- Type the following expression to the console below:
- Congratulations, Hello world works! Now type another expression like the following: (+ 1 2)
Follow a video on how to code Clojure
We started a Clojure project at Solita a couple of months ago. We held some introduction sessions and recorded them on video. We thought that someone else could also find them useful and thus put them to YouTube. The guy teaching us Clojure on the video is Jari Länsiö from Metosin. Thanks Jarppe for sharing your knowledge on Clojure!
Congratulations, you have now familiarized yourself with Clojure! I would like to hear your comments on the material. How could we improve it? What kind of topics are you interested in?