chibi-scheme/tests/basic/test00-fact-3.scm
Alex Shinn d451a053ca changed type opcode generators to use type objects, not ids
also fixed support for float/double types
2010-09-17 01:47:21 +00:00

14 lines
187 B
Scheme

(define (fact-helper x res)
(if (= x 0)
res
(fact-helper (- x 1) (* res x))))
(define (fact x)
(fact-helper x 1))
(display "(fact 3) => ")
(write (fact 3))
(newline)