]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex3_8.rkt
Lazy version of evaluator and tests.
[sicp.git] / src / sicp / ex3_8.rkt
1 #lang racket
2
3 (define f
4   (let ((x 0))
5     (lambda (y)
6       (set! x (+ x 1))
7       (cond 
8         ((and (= x 1) (= y 0)) -1)
9         ((and (= x 2) (= y 1)) 1)
10         ((and (= x 1) (= y 1)) 0)
11         ((and (= x 2) (= y 0)) 1)))))
12