learning-sicp

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

exercise-3.scm (459B)


      1 (define-library (sicp tests chapter-3 exercise-3)
      2   (import (scheme base)
      3           (srfi :64)
      4           (sicp solutions chapter-3 exercise-3))
      5 
      6   (begin
      7     (define acc
      8       (make-account 100 'secret-password))
      9 
     10     (test-begin "chapter-3-exercise-3")
     11     (test-equal
     12         60
     13       ((acc 'secret-password 'withdraw) 40))
     14     (test-equal
     15         "Incorrect password"
     16       ((acc 'some-other-password 'deposit) 50))
     17     (test-end "chapter-3-exercise-3")))