sicp 笔记 (9)

第三章习题 3.73 - 3.82 的解答。

E-3.73:

(load "../examples/3.5.2-infinite-streams.scm")

(define (integral integrand initial-value dt)
  (define int
    (cons-stream initial-value
                 (add-streams (scale-stream integrand dt)
                              int)))
  int)

(define (RC resistance capacitance time-step)
  (lambda (currents initial-voltage)
    (cons-stream initial-voltage
                 (add-streams (scale-stream currents resistance)
                              (integral (scale-stream currents 

阅读全文…