【SICP练习】119 练习3.50

简介:

练习3-50

原文

Exercise 3.50. Complete the following definition, which generalizes stream-map to allow procedures that take multiple arguments, analogous to map in section 2.2.3, footnote 12.

(define (stream-map proc . argstreams)  
   (if (<??> (car argstreams))  
       the-empty-stream     
       (<??>      
        (apply proc (map <??> argstreams))  
        (apply stream-map          
            (cons proc (map <??> argstreams))))))

代码

(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))))))
;Value: stream-map



感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。


为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp


目录
相关文章
|
Go
【SICP练习】146 练习4.2
版权声明:转载请联系本人,感谢配合!本站地址:http://blog.csdn.net/nomasp https://blog.csdn.net/NoMasp/article/details/44729521 练习4-2 原文 Exercise 4.
671 0
下一篇
无影云桌面