-
Notifications
You must be signed in to change notification settings - Fork 6
Clojure
Will Fuqua edited this page Jul 28, 2016
·
3 revisions
What is Clojure?
Clojure is a dynamic, general-purpose programming language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is predominantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded designs.
- From http://clojure.org/
What does it look like?
; Add two numbers together
(+ 1 2) ; returns 3
; Add a bunch of numbers together
(+ 1 2 3 4 5) ; returns 15
; Increment a bunch of numbers
(map inc [1 2 3 4 5]) ; returns (2 3 4 5 6)
; Define a function and then call it
(defn greet [name]
(str "Hello " name))
(greet "Chewbacca") ; returns "Hello Chewbacca"
Where can I learn more?
-
Try Clojure - No installation required! Try typing
(+ 2 2)
. Hopefully you get4
. - Clojure for the Brave and True - A great tutorial that covers installation, basic programming and advanced patterns.
- ClojureScript Koans - Learn ClojureScript (which is like Clojure, but compiles to javascript) by filling in the blanks.
- 4Clojure - A series of fill in the blanks programming problems with ascending difficulty and leaderboards