aboutsummaryrefslogtreecommitdiff
path: root/tests/perf2.mal
blob: 38891911535a4d70482b191d24a772ccf8cf6f05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
(load-file "../core.mal")

;;(prn "Start: basic math/recursion test")

(def! sumdown (fn* (N) (if (> N 0) (+ N (sumdown  (- N 1))) 0)))
(def! fib (fn* (N) (if (= N 0) 1 (if (= N 1) 1 (+ (fib (- N 1)) (fib (- N 2)))))))

(time (do
  (sumdown 10)
  (fib 12)))

;;(prn "Done: basic math/recursion test")