learning-sicp

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

exercise-8.scm (591B)


      1 (define-library (sicp tests chapter-3 exercise-8)
      2   (import (scheme base))
      3   (import (srfi srfi-64))
      4   (import (only (sicp solutions chapter-3 exercise-8) make-f))
      5 
      6   (begin
      7     (define f (make-f))
      8 
      9     (test-begin "chapter-3-exercise-8")
     10     (test-equal
     11         1 ; Turns out it starts with the right one.
     12       ;; People of #scheme @ libera.chat say it is an implementation detail.
     13       ;; The specification leaves the order of evaluation unspecified,
     14       ;; and therefore one should avoid writing code that depends on it.
     15       (+ (f 0) (f 1)))
     16     (test-end "chapter-3-exercise-8")))