练习3-55
原文
Exercise 3.55. Define a procedure partial-sums that takes as argument a stream S and returns the stream whose elements are S0, S0 + S1, S0 + S1 + S2, …. For example, (partial-sums integers) should be the stream 1, 3, 6, 10, 15, ….
代码
(define (partial-sums s)
(cons-stream (stream-car s) (add-streams (stream-cdr s) (partial-sums s))))
感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。
为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp