damn tweaks14
authorJim Pryor <profjim@jimpryor.net>
Wed, 15 Sep 2010 16:03:41 +0000 (12:03 -0400)
committerJim Pryor <profjim@jimpryor.net>
Wed, 15 Sep 2010 16:03:41 +0000 (12:03 -0400)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
damn.mdwn

index b0b2d61..cd01134 100644 (file)
--- a/damn.mdwn
+++ b/damn.mdwn
@@ -199,8 +199,8 @@ We get something like this:
 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`.
 
 
 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`.
 
 
-But
----
+But...
+------
 
 As came out in discussion, the `print` we're using here already constitutes a kind of side-effect mechanism of its own. If you say:
 
 
 As came out in discussion, the `print` we're using here already constitutes a kind of side-effect mechanism of its own. If you say:
 
@@ -248,7 +248,7 @@ It's not immediately clear how to do it with "undelimited" continuations, of the
        (define damn (lambda () (call/cc (lambda (k) (cons (cons 'side-effect 'bad) (k 'id))))))
 
 
        (define damn (lambda () (call/cc (lambda (k) (cons (cons 'side-effect 'bad) (k 'id))))))
 
 
-The idea here is we capture the continuation that the thunk `(damn)` has when it gets evaluated. This continuation is bound to the variable `k`. We supply `'id` as an argument to that continuation. When the main, at-issue tree is all built, then we return a pair `((side-effect bad) AT-ISSUE-TREE)`.
+The idea here is we capture the continuation that `(damn)` has when it gets evaluated. This continuation is bound to the variable `k`. We supply `'id` as an argument to that continuation. When the main, at-issue tree is all built, then we return a pair `'((side-effect bad) AT-ISSUE-TREE)`.
 
 However, this doesn't work. The reason is that an undelimited continuation represents the future of the evaluation of `(damn)` *until the end of the computation*. So when `'id` is supplied to `k`, we go back to building the at-issue tree until we're finished *and that's the end of the computation*. We never get to go back and evaluate the application of `(cons (cons 'side-effect 'bad) <>)` to anything.
 
 
 However, this doesn't work. The reason is that an undelimited continuation represents the future of the evaluation of `(damn)` *until the end of the computation*. So when `'id` is supplied to `k`, we go back to building the at-issue tree until we're finished *and that's the end of the computation*. We never get to go back and evaluate the application of `(cons (cons 'side-effect 'bad) <>)` to anything.
 
@@ -270,7 +270,7 @@ but the behavior is the same. It's just that now our continuation doesn't stretc
 
        (reset ...)
 
 
        (reset ...)
 
-This is a kind of continuation-scope-marker. There are some interesting default behaviors if you don't explicitly specify where the limits are. But we'll be fully explicit here.
+This is a kind of continuation-scope-marker. There are some interesting default behaviors if you don't explicitly specify where the limits are. In fact, in the interactive interpreter we wouldn't need to ever explicitly mark the scopes. They'd by default be just where we want them to be. But we'll be fully explicit here.
 
 If a block `...` never invokes a shift, then `(reset ...)` will evaluate just the same as `...`. So for uniformity, we can designate our continuation-scopes even on computations that don't capture and manipulate continuations.
 
 
 If a block `...` never invokes a shift, then `(reset ...)` will evaluate just the same as `...`. So for uniformity, we can designate our continuation-scopes even on computations that don't capture and manipulate continuations.
 
@@ -286,7 +286,7 @@ We evaluate:
                                          (cons (damn) 
                                                'book)))))
 
                                          (cons (damn) 
                                                'book)))))
 
-Remember, the reset isn't actually *doing* anything. It's not a function that's taking the other material as an argument. It's instead a scope-marker. Here it's not even needed (and in fact in the interactive interpreter, it wouldn't even be needed when we invoke continuations, because of the default position it takes).  But we're inserting it to be explicit and uniform.
+Remember, the reset isn't actually *doing* anything. It's not a function that's taking the other material as an argument. It's instead a scope-marker. Here it's not even needed; but we're inserting it anyway to be explicit and uniform.
 
 Evaluating that gives us:
 
 
 Evaluating that gives us: