cycle2.scm 336 B

1234567891011121314151617
  1. (module-name <cycle2>)
  2. (module-export is-odd? c2x double-c1x)
  3. (require <cycle1>)
  4. (define c2x 3)
  5. (double-c2x)
  6. (define (double-c1x)
  7. (set! c1x (* 2 c1x)))
  8. (define one :: <int> 0)
  9. ; Verifies that body is executed exactly once.
  10. (set! one (+ one 1))
  11. (define (is-odd? (x :: <int>)) :: <boolean>
  12. (if (= x 0) #f (is-even? (- x one))))