Summary
In this chapter, we looked at the Clojure language, a language that is quite different from the other languages covered in this book. After writing a lot of one-line expressions in the REPL environment, I hope you discovered that learning the Clojure syntax is not that difficult at all. By just creating lists that contain expressions, often nested in multiple lists, one can write surprisingly readable code. We also learned that Clojure is a functional programming language and that its most important data structures are immutable. Unlike Java, Clojure is not an object-orientated language at heart, but it offers very good compatibility with the JVM platform. We created some instances of JVM objects and called methods and read fields from them. Finally, we looked at agents, a safe way to manage states in a multithreading application. We even wrote a simple application to try them out.
Now that you know the most important rules of Clojure, you are ready to write a real application.