post-scarcity/lisp/fact.lisp
Simon Brooke 70376c6529 Careful debugging of the memory leak problem. At this stage,
stack frames for interpreted (but not primitive) functions appear not to be being
reclaimed, and the oblist doesn't seem to be being fully reclaimed.
2026-02-20 19:39:19 +00:00

9 lines
173 B
Common Lisp

(set! fact
(lambda (n)
"Compute the factorial of `n`, expected to be a natural number."
(cond ((= n 1) 1)
(t (* n (fact (- n 1)))))))
(fact 25)