Code as data
The most remarkable thing you might notice when coming to Clojure from Java is that it is homoiconic, which means the code is written in the form of the language’s data structures. This practice, also known as code as data, results in very consistent syntax with a limited number of keywords and constructs. It also creates a meta-programming model using “syntax-aware” code templates (called macros).
The idea is that any snippet of Clojure code is also an instance of Clojure data. You will see this most frequently in the list syntax, because most of Clojure is written as lists. Here is a simple “Hello, InfoWorld” function in Clojure:
(defn hello-infoworld []
(println "Hello, InfoWorld"))
The parentheses indicate a list in Clojure. So, the definition of this function is essentially just the definition of a list with a keyword (defn), a function name (hello-infoworld), an empty argument vector ([]), and the function body. The function body is also a list containing a function call (println) and the argument to that function (“Hello, InfoWorld”).



