learning-sicp

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

exercise-7.scm (745B)


      1 (define-library (sicp tests chapter-4 exercise-7)
      2   (import (scheme base)
      3 
      4           (srfi :64)
      5 
      6           (sicp solutions chapter-4 exercise-7)
      7 
      8           (sicp utils))
      9 
     10   (begin
     11     (debug! #t)
     12 
     13     (test-begin "chapter-4-exercise-7")
     14 
     15     (test-equal 1
     16       (eval '(let* ()
     17                1)
     18             (setup-environment)))
     19 
     20     (test-equal 1
     21       (eval '(let* ((a 2))
     22                (+ -1 a))
     23             (setup-environment)))
     24 
     25     (test-equal 5
     26       (eval '(let* ((a 2)
     27                     (b 3))
     28                (+ a b))
     29             (setup-environment)))
     30 
     31     (test-equal 30
     32       (eval '(let* ((a 2)
     33                     (b (+ 1 a)))
     34                (* a b 5))
     35             (setup-environment)))
     36 
     37     (test-end "chapter-4-exercise-7")))