This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; The direct style recursion faculty function | |
(defn fac-ds [n] | |
(if (zero? n) 1 | |
(* n (fac (dec n))))) | |
(fac 5) | |
;; => 120 | |
;; The tail recursive faculty function | |
(defn fac-tail [n] |