AnatomyOf

Anatomy of a Clojure file

example.clj
1;; A minimal Clojure script. No loops, no problem -- just recursion all the way down.
2
3(def greeting "Hello")
4
5(defn greet
6 "Greets whoever wandered into the REPL."
7 [name]
8 (let [message (str greeting ", " name "!")]
9 (println message) ; side effect, the REPL forgives you
10 message))
Clojure is a dialect of Lisp, hosted on the JVM, emphasizing functional programming and immutable data structures.