learning-sicp

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

exercise-17.scm (645B)


      1 (define-library (sicp tests chapter-1 exercise-17)
      2   (import (scheme base)
      3           (srfi :64)
      4           (sicp solutions chapter-1 exercise-17))
      5 
      6   (begin
      7     (test-begin "chapter-1-exercise-17")
      8     (test-equal (*-recursive 2 3) (fast-*-recursive 2 3))
      9     ;; a * b =
     10     ;; 2 * 3 = odd b
     11     ;; 4 * 2 = even b
     12     ;;
     13 
     14     (test-equal (* 3 5) (*-recursive 3 5))
     15     (test-equal (* 5 7) (*-recursive 5 7))
     16     (test-equal (* 7 11) (*-recursive 7 11))
     17 
     18     (test-equal (* 3 5) (fast-*-recursive 3 5))
     19     (test-equal (* 5 7) (fast-*-recursive 5 7))
     20     (test-equal (* 7 11) (fast-*-recursive 7 11))
     21     (test-end "chapter-1-exercise-17")
     22     ))