learning-sicp

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

exercise-8.scm (561B)


      1 (define-library (sicp tests chapter-4 exercise-8)
      2   (import (scheme base)
      3 
      4           (srfi :64)
      5 
      6           (sicp solutions chapter-4 exercise-8)
      7 
      8           (sicp utils))
      9 
     10   (begin
     11     (debug! #t)
     12 
     13     (test-begin "chapter-4-exercise-8")
     14 
     15     (test-equal 1
     16       (eval '(let loop ()
     17                1)
     18             (setup-environment)))
     19 
     20     (test-equal 3628800
     21       (eval '(let loop ((n 10))
     22                (cond
     23                 ((= n 0) 1)
     24                 (else (* n (loop (- n 1))))))
     25             (setup-environment)))
     26 
     27     (test-end "chapter-4-exercise-8")))