Tail recursion: Difference between revisions

Content deleted Content added
m Examples: Removing the argument validation, as it's not present in the first example and therefore only confusing
Line 35:
(define factorial
(lambda (n)
(if (and (integer?let n)fact (>=[i n] [acc 0)1])
(letif fact(zero? ([i n] [acc 1])
(if (zero? i)acc
(fact (- i 1) (* acc i))))))
(fact (- i 1) (* acc i))))
(assertion-violation
'factorial "invalid argument" n))))
</source>