// not tail call optimized
(def! fact (fn* (x) (if (= x 0) 1 (* x (fact (- x 1) )) )))
// tail call opt
(def! fact-tail (fn* [x accum] (if (= x 0) accum (fact-tail (- x 1) (* x accum)))))
(def! fact (fn* [x] (fact-tail x 1)) )
No formatting because... newlines mess up interpreter parsing.