]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex4_15.rkt
Solution to 4.33. This had been difficult to get right, though conceptually it was
[sicp.git] / src / sicp / ex4_15.rkt
1 #lang racket
2
3 (define (run-forever)
4   (run-forever))
5
6 (define (try p)
7   (if (halts? p p)
8       (run-forever)
9       'halted))
10
11 #|
12
13 Now, if you run (try try) then, we check if (try try) would halt. If it halts, then we run forever, else we return.
14 This is contradictory to the assumption.
15
16 |#