learning-sicp

My embarrassing half assed SICP run.
git clone https://kaka.farm/~git/learning-sicp
Log | Files | Refs

exercise-33.scm (1002B)


      1 (define-library (sicp tests chapter-1 exercise-32)
      2   (import (scheme base))
      3   (import (srfi :64))
      4   (import (sicp solutions chapter-1 exercise-33))
      5 
      6   (begin
      7     (test-begin "chapter-1-exercise-33")
      8     (test-equal
      9         (iterative-filtered-accumulate odd?
     10                                        +
     11                                        0
     12                                        (lambda (x) (* x x))
     13                                        0
     14                                        (lambda (x) (+ 1 x))
     15                                        100)
     16       (recursive-filtered-accumulate odd?
     17                                      +
     18                                      0
     19                                      (lambda (x) (* x x))
     20                                      0
     21                                      (lambda (x) (+ 1 x))
     22                                      100))
     23     (test-equal
     24         (iterative-sum-of-squares 2 100)
     25       (recursive-sum-of-squares 2 100))
     26     (test-end "chapter-1-exercise-33")))