damn tweaks19, delete *.rkt
authorJim Pryor <profjim@jimpryor.net>
Wed, 15 Sep 2010 17:52:58 +0000 (13:52 -0400)
committerJim Pryor <profjim@jimpryor.net>
Wed, 15 Sep 2010 17:52:58 +0000 (13:52 -0400)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
damn.mdwn
damn.rkt [deleted file]
damn2.rkt [deleted file]
damn3.rkt [deleted file]
damn4.rkt [deleted file]

index f484a96..a685162 100644 (file)
--- a/damn.mdwn
+++ b/damn.mdwn
@@ -299,7 +299,7 @@ Now to pair that with an affective side-issue content, we'd instead define `damn
 
        (define damn (lambda () (shift k (cons (cons 'side-effect 'bad) (k 'id)))))
 
-And voil&agrave;.
+And voil&agrave;!
 
        (reset (cons (cons 'the 'man) 
                  (cons 'read
diff --git a/damn.rkt b/damn.rkt
deleted file mode 100644 (file)
index b7726af..0000000
--- a/damn.rkt
+++ /dev/null
@@ -1,14 +0,0 @@
-#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))))))
diff --git a/damn2.rkt b/damn2.rkt
deleted file mode 100644 (file)
index be328fd..0000000
--- a/damn2.rkt
+++ /dev/null
@@ -1,11 +0,0 @@
-#lang racket
-;(define damn (lambda () 'id))
-(define damn (lambda () (call/cc (lambda (k) 
-                                  ; (k 'id)
-                                   (print "Something's bad")
-                                   (k 'id)
-                                   ))))
-
-(list (list 'the (list (damn) 'man))
-      (list 'read 
-            (list 'the (list (damn) 'book))))
diff --git a/damn3.rkt b/damn3.rkt
deleted file mode 100644 (file)
index a087b4b..0000000
--- a/damn3.rkt
+++ /dev/null
@@ -1,67 +0,0 @@
-#lang racket
-(require racket/control)
-
-(define damn0 (lambda ()
-                               'id))
-
-(define damn1 (lambda ()
-                               (cons '("side effect" bad)
-                                         'id)))
-
-(define damn2 (lambda () (shift k
-                                                               (cons '("side effect" bad) 
-                                                                         (list (k 'id))))))
-
-(define damn3 (lambda () (shift k
-                                                               (list (k 'id)
-                                                                         '("side effect" bad)))))
-
-
-; Now if we use damn0, our compositional semantics will work OK but
-; we don't yet have any expressive contribution:
-
-(list "main content" 'i (list 'like (list 'the (damn0) 'boy)))
-; '("main content" i (like (the id boy)))
-
-
-; If we use damn1, we've added in the expressive side-effect:
-
-(list "main content" 'i (list 'like (list 'the (damn1) 'boy)))
-; '("main content" i (like (the (("side effect" bad) . id) boy)))
-
-; However, the context (list 'the ... 'boy) is now being asked to operate
-; on an element (("side effect" bad) . id), and it may complain it doesn't
-; know what that is. It knows how to use 'id to get (list 'the 'id 'boy),
-; and how to use 'bad to get (list 'the 'bad 'boy), but we're supposed to
-; have something different here.
-
-; To get what we want we need to use (delimited) continuations:
-(reset (list "main content" 'i (list 'like (list 'the (damn2) 'boy))))
-; '(("side effect" bad) ("main content" i (like (the id boy))))
-
-; or to get the side effect at the end:
-
-(reset (list "main content" 'i (list 'like (list 'the (damn3) 'boy))))
-; '(("main content" i (like (the id boy))) ("side effect" bad))
-
-; If you're working in the interactive interpreter, the outermost "reset" here
-; is already in its default position, so it doesn't need to be explicitly
-; specified:
-
-(list "main content" 'i (list 'like (list 'the (damn2) 'boy)))
-; '(("side effect" bad) ("main content" i (like (the id boy))))
-
-; However, if you're executing this as a file, you would need to include explicit resets.
-
-
-
-; Instead of using reset/shift you could use an element like "print" in
-; building the side-effect, as we did in class. Here you wouldn't require an
-; explicit continuation, but as Chris said, that's because "print" already
-; represents an implicit continuation.
-
-(define damn4 (lambda () (begin (print "bad") 'id)))
-(list "main content" 'i (list 'like (list 'the (damn4) 'boy)))
-; "bad"'("main content" i (like (the id boy)))
-;
-
diff --git a/damn4.rkt b/damn4.rkt
deleted file mode 100644 (file)
index 65fb49e..0000000
--- a/damn4.rkt
+++ /dev/null
@@ -1,17 +0,0 @@
-#lang racket
-
-; thanks to Ken!
-
-(let ((pragma
-       ; An ordered pair whose first component is the assertion
-       ; operator, a unary function, and whose second component
-       ; is the meaning of "damn", a thunk.
-       (call-with-current-continuation
-        (lambda (k)
-          (cons (lambda (prop) prop)
-                (lambda () (k (cons (lambda (prop) (list 'bad prop))
-                                    (lambda () 'id)))))))))
-  (let ((assert (car pragma))
-        (damn   (cdr pragma)))
-    (assert (list 'the 'student 'read 'the (damn) 'book))))
-