]> git.rkrishnan.org Git - sicp.git/commitdiff
solution to 4.15
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Sat, 10 Dec 2011 19:02:37 +0000 (00:32 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Sat, 10 Dec 2011 19:02:37 +0000 (00:32 +0530)
src/sicp/ex4_15.rkt [new file with mode: 0644]

diff --git a/src/sicp/ex4_15.rkt b/src/sicp/ex4_15.rkt
new file mode 100644 (file)
index 0000000..689a1c9
--- /dev/null
@@ -0,0 +1,16 @@
+#lang racket
+
+(define (run-forever)
+  (run-forever))
+
+(define (try p)
+  (if (halts? p p)
+      (run-forever)
+      'halted))
+
+#|
+
+Now, if you run (try try) then, we check if (try try) would halt. If it halts, then we run forever, else we return.
+This is contradictory to the assumption.
+
+|#
\ No newline at end of file