Clojure notes
; comment
( + 1 2 ) ; reverse polish: resolves to 3
'( true false nil )
'( list, apostrophe so it doesn't eval) [vector] { :key val }
; 4clojure examples of functions
( ( fn add-five [ x ]
( + x 5 ) ; I'm breaking these to my liking
) 3 ; default argument
)
( fn [x]
( + x 5 )
)
( # ( + % 5 ) 3 )
( partial + 5 )
( = '( 6 7 8) ( map # ( + % 5 ) '( 1 2 3 ) ) )
( str "concatenates" " these" )
( if ( zero? 5 )
( + x 5 ) ; then_do
( - x 5 ) ; else
)
keywords for notepad++ thingy
if if-not when when-not case do recur dotimes try catch throw case
str first nth last rest nil? zero? pos? neg? even? pr count map reduce contains? conj peek pop for