(println "hello world")an empty sequence
'()adding an element to the list
(conj '() 1)the order of inserting into the list is important:
(conj '() 1 2 3 4)(def variable 1)(def other-symbols-as-well true)(def is-true? true)let's try mutating the state*:
(def listt '(1 2 3))
(cons 4 listt)what is the value of listt?
(def listt (cons 4 listt))is not very idiomatic.
What do you want to do with it?
(defn add [a b] (+ a b))
(def add2 (partial add 2))
(add2 4)(def o {:a 1 :b identity})
((:b o) 5)(defn applier[f coll]
(map f coll))
(applier identity '(1 2 3))another example:
(applier inc '(1 2 3))
(inc 0)
(applier dec '(1 2 3))
(dec 0)it could be simplified to this:
(def applier map)