]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex3_60.rkt
Solution to 4.33. This had been difficult to get right, though conceptually it was
[sicp.git] / src / sicp / ex3_60.rkt
1 #lang racket
2
3 (define (mul-series s1 s2)
4   (cons-stream (* (stream-car s1)
5                   (stream-car s2))
6                (add-streams (scale-stream (stream-cdr s1) (stream-car s2))
7                             (add-streams 
8                              (scale-stream (stream-cdr s2) (stream-car s1))
9                              (mul-series (stream-cdr s1) 
10                                          (stream-cdr s2))))))