Fix my fact impl, add print and println

This commit is contained in:
Nathan Braswell
2020-04-18 13:36:46 -04:00
parent cc833015c3
commit 50817b567f
2 changed files with 41 additions and 7 deletions

9
bf.kp
View File

@@ -66,5 +66,10 @@
;(def! other (fn* [a b c] (- (+ a b) c)))
;(def! main (fn* [] (other 13 1 4)))
(def! other 12)
(def! main (fn* [] (+ other 4)))
;(def! other 12)
;(def! main (fn* [] (+ other 4)))
(def! fact (fn* [n] (if (<= n 1) 1 (* (fact (- n 1)) n))))
(def! main (fn* [] (let* (to_ret (fact 5))
(do (println to_ret)
to_ret))))