Skip to content

Instantly share code, notes, and snippets.

View akonring's full-sized avatar

Anders Konring akonring

View GitHub Profile
@akonring
akonring / fac-fun.clj
Created December 5, 2013 12:12
Different faculty implementations using Clojure
;; 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]