Tail recursion: Difference between revisions

Content deleted Content added
No edit summary
Line 33:
;; to calculate the product of all non-negative integers
;; less than or equal to n.
(define (factorial n)
(lambdalet fact ([i n] [acc 1])
(letif fact(zero? ([i n] [acc 1])
(if (zero? i)acc
(fact (- i 1) (* acc i)))))
(fact (- i 1) (* acc i))))))
</source>