(defn fact [x]
  (loop [n x prod 1] ;; this works just like a 'let' binding.
    (if (= 1 n)  ;; this is the base case.
      prod
      (recur (dec n) (* prod n)))))

(println (fact 5)) ;; change 5 to whatever number you like!

;; ...but not more than 20, or you'll get an integer overflow error.
;; to fix this, you can add 'N' to the end of any number to make it a bigint.
;; 21 -> 21N