Clojure (born in 2007) is one of the several languages built on the virtualisation part of Java, the JVM, making it compatible with Java code and the Java runtime environment.
Clojure is a Lisp (List processing) language meaning that it treats data and the code itself as linked lists and tends to make a lot of use of macros.
This code fragment computes the sum and product of an array of integers:
Clojure – sum and product of an array
(defn sum [vals] (reduce + vals))
(defn product [vals] (reduce * vals))
Reason To Learn:
If you want to flirt with functional programming (FP) but don’t want to go all the way. functional programming makes the most of the ability of modern multi-core processors to support concurrency, but pure FP languages like Haskell are too much of a leap for some.
Clojure is a general-purpose language, like Java, with which it is compatible. Unlike Java, though, the syntax is simple, consistent and concise. Plus you can interact live with a running program to see what the separate functions do rather than having to recompile and run it after every change.