This repository has been archived on 2022-08-10. You can view files and clone it, but cannot push or open issues or pull requests.
chez-openbsd/examples/fib.ss

10 lines
187 B
Scheme
Raw Normal View History

2022-07-29 15:12:07 +02:00
;;; simple fibonacci function
;;; uses trace-lambda to show the nesting
(define fib
(trace-lambda fib (x)
(if (<= x 1)
1
(+ (fib (- x 1)) (fib (- x 2))))))