Create again.myc
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
;; Benchmark: 2.5us
|
||||||
|
;; Benchmark-Repeat: 804
|
||||||
|
;; Output: 120
|
||||||
|
(do
|
||||||
|
(def factorial (fn [n acc]
|
||||||
|
(if (= n 0)
|
||||||
|
acc
|
||||||
|
(again [(- n 1) (* acc n)]))))
|
||||||
|
|
||||||
|
(factorial 5 1))
|
||||||
Reference in New Issue
Block a user