]> git.rkrishnan.org Git - sicp.git/commitdiff
solution to 3.50
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Fri, 1 Jul 2011 17:06:21 +0000 (22:36 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Fri, 1 Jul 2011 17:06:21 +0000 (22:36 +0530)
src/sicp/ex3_50.rkt [new file with mode: 0644]

diff --git a/src/sicp/ex3_50.rkt b/src/sicp/ex3_50.rkt
new file mode 100644 (file)
index 0000000..be655d3
--- /dev/null
@@ -0,0 +1,9 @@
+#lang racket
+
+(define (stream-map proc . argstreams)
+  (if (stream-null? (car argstreams))
+      the-empty-stream
+      (cons-stream
+       (apply proc (map stream-car argstreams))
+       (apply stream-map
+              (cons proc (map stream-cdr argstreams))))))
\ No newline at end of file