Recursive Functions
A function may be defined in terms of itself.
> (defun factorial (n)
"Returns factorial of N."
(if (= n 1) 1
(* n (factorial (- n 1))) ) )
FACTORIAL
> (factorial 5)
120
> (factorial 20)
2432902008176640000
Previous slide
Next slide
Back to first slide
View graphic version