damn tweaks3
[lambda.git] / damn.mdwn
index 1342254..6dca070 100644 (file)
--- a/damn.mdwn
+++ b/damn.mdwn
@@ -65,7 +65,6 @@ evaluates to the nested structure of pairs that Scheme displays as:
        ((the . man) . (read . (the . book)))
 
 and that we can think of as the tree:
-;
 
                                 /----------------\
                                /                  \
@@ -154,14 +153,16 @@ Chris and others have applied the apparatus of continuations to the analysis of
 
 is Scheme's way of saying:
        
->      bind the continuation of this very complex expression to k and evaluate the `...`
+>      bind the continuation of this complex expression to `k` and evaluate the `...`
 
 
 So now we define `damn` like this:
 
        (define damn (lambda () (call/cc (lambda (k) (print "bad") (k 'id)))))
 
-Now when we do:
+In other words, `damn` is a thunk. When that thunk is evaluated (`(damn)`), we capture the pending future of the computation and bind that to `k`. Then we print "bad" and supply the argument `'id` to `k`. This last step means we go on evaluating the pending future contribution as if `(damn)` had simply returned `'id`.
+
+What happens then when we evaluate:
 
        (cons (cons 'the 'man) 
                  (cons 'read
@@ -169,9 +170,9 @@ Now when we do:
                                          (cons (damn) 
                                                'book))))
 
-we get something like this:
+We get something like this:
 
-       <bold>"bad"</bad> ((the . man) . (read . (the . (id . book))))
+>      <bold>"bad"</bad> ((the . man) . (read . (the . (id . book))))
 
 Yay! The affective meaning has jumped out of the compositional evaluation of the main sentence, and the context `(the . (... . book))` only has to deal with the trivial adjectival meaning `'id`.