Reading — step 1 of 5
Learn
Clojure was created in 2007 by Rich Hickey. It's a modern Lisp dialect targeting the JVM (also JavaScript via ClojureScript). Designed around immutable data and pure functions, with first-class concurrency primitives.
Clojure code is data — programs are written as nested lists. The first element is the function, the rest are arguments:
(println "Hello, Clojure!")
That's a list with two elements: the function println and the string "Hello, Clojure!". Parentheses define lists; lists define calls.
Basic arithmetic looks unfamiliar at first — it's also function calls:
(+ 1 2 3) ; 6
(* 2 (+ 3 4)) ; 14
(- 10 3 2) ; 5
Semicolons start line comments. ;; is conventional for full-line comments, ; for inline.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…