12 Jan 2018 | clojure
The entrie line of the code (….) is called a form in Clojure
(println "Hello World")
We call the mapping between names and values binding in Clojure
Symbol
(let [a "aaaaa"] (println a))
Scope
Defn
Fn (Anonymous Funtion) #() is the shortcut for fn
Closure
`(1 2 3)
=> (1 2 3)
(conj `(1 2 3) 4)
=> (4 1 2 3)
(nth '(1 2 3) 1)
=> 2
(count `(1 2 3))
=> 3
[1 2 3]
(.indexOf [1 2 3] 2)
=> 1
(conj (conj #{1 2 3} 4) 4)
=> #{ 1 4 2 3}
(disj #{1 2 3} 3)
=> #{1 2}
(sort (conj #{1 2 3} 4))
=> (1 2 3 4)
(contains? #{1 2 3} 1)
=> true
(clojure.set/subset? #{1 2} #{1 2 3 4})
=> true
(clojure.set/superset? #{1 2 3} #{1 2})
=> true