This repository has been archived on 2022-08-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
chez-openbsd/examples/fib.ss
2022-07-29 15:12:07 +02:00

9 lines
187 B
Scheme

;;; 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))))))