Notes re lecture 1
[lambda.git] / damn.rkt
diff --git a/damn.rkt b/damn.rkt
new file mode 100644 (file)
index 0000000..b7726af
--- /dev/null
+++ b/damn.rkt
@@ -0,0 +1,14 @@
+#lang racket
+;((lambda () (list 'John (list 'read (list 'the (list ((lambda () 'id)) 'book))))))
+
+;(define damn (lambda () 'id))
+
+(define damn (lambda () (call/cc (lambda (k) (raise (list "Something's bad" k))))))
+
+(call-with-exception-handler
+ (lambda (e) (print (first e)) ((second e) 'id)) ; this is the exception handler
+ (lambda ()
+   (list (list 'the (list (damn) 'man))
+         (list 'read
+               (list 'the
+                     (list (damn) 'book))))))