]> git.rkrishnan.org Git - sicp.git/commitdiff
solution to 3.60. Untested. Skipping 3.61 and 3.62.
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Sun, 10 Jul 2011 04:41:44 +0000 (10:11 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Sun, 10 Jul 2011 04:52:37 +0000 (10:22 +0530)
src/sicp/ex3_60.rkt [new file with mode: 0644]

diff --git a/src/sicp/ex3_60.rkt b/src/sicp/ex3_60.rkt
new file mode 100644 (file)
index 0000000..1110c28
--- /dev/null
@@ -0,0 +1,10 @@
+#lang racket
+
+(define (mul-series s1 s2)
+  (cons-stream (* (stream-car s1)
+                  (stream-car s2))
+               (add-streams (scale-stream (stream-cdr s1) (stream-car s2))
+                            (add-streams 
+                             (scale-stream (stream-cdr s2) (stream-car s1))
+                             (mul-series (stream-cdr s1) 
+                                         (stream-cdr s2))))))
\ No newline at end of file