Problem 3.2: Fibonacci (100 pts)
For this problem, you may use the naturals
stream in addition to combine-with
defined above. We highly recommend you do not define any other helper functions. Such problems are likely to appear on final exam.
Write fibs
, which is a stream where the n
th term represents the n
th Fibonacci number.
(define fibs
'YOUR-CODE-HERE
)
;;; Tests
; scm> (slice fibs 0 10)
; (0 1 1 2 3 5 8 13 21 34)