sicp-all-tasks/sicp/3_002e55

47 lines
415 B

Exercise 3.55: Define a procedure
partial-sums that takes as argument a stream
S
and returns the
stream whose elements are
S
0
,
S
0
+
S
1
,
S
0
+
S
1
+
S
2
,
.
For example, (partial-sums integers) should be the
stream 1, 3, 6, 10, 15, ….