how to define a function in clojure code example
Example 1: how to make a functionn in clojure
(defn foo
"
foo
Demonstrates the body of a function
"
[param param2 ... ] ; params are seperated by spaces not commas
;stuff to do in here
)
Example 2: call function in clojure
(defn square [x]
(* x x))
(println (square 2))
; 4
(println (square 3))
; 9