62 `(cons M N)` is a request to build an ordered pair out of the values M and N.

63 Scheme displays that pair as `'(M . N)` You can't write `(M . N)` yourself and expect Scheme to understand that you're talking about this pair. If you tried to, Scheme would think you're trying to apply the function M to some arguments, which you're not, and also

64 Scheme would be confused by what argument the `.` is supposed to be. So, you say:

72 You *can* write `'(M . N)` (with the prefixed single quote), and Scheme will understand you then. However, we're going to be using that same single quote prefix to do something else in a moment, and I don't want now to explain how these uses are related. So we'll write out `(cons M N)` longhand, and we'll leave the `'(M . N)` notation to Scheme for displaying the pair we built.

74 There is an underlying reason why parentheses are used both when displaying the ordered pair, and also to mean "apply this function to these arguments." However, at this point, you may well see this as a confusing overloading of parentheses to fill different syntactic roles.

76 Now what about the elements of our ordered pairs. Why do we say `(cons 'the 'man)`. Why are those single quotes there? Well, if you just said `(cons the man)`, Scheme would understand `the` and `man` to be variables, and it would complain that you hadn't bound these variables to any values. We don't want to build an ordered pair out of the values possessed by variables `the` and `man`. Instead, we want to just make up some primitive value THE to stand for the meaning of an object-language determiner, and some primitive value MAN to stand for the meaning of an object-language noun. The notation `'the` is Scheme's way of designating a primitive atomic value. Note there is no closing single quote, only a prefixed one. Scheme calls these primitive atomic values "symbols." That term is a bit misleading, because the symbol `'the` is not the same as the variable `the`. Neither is it the same as what's called the string `"the"`. The latter is a structured value, composed out of three character values. The symbol `'the`, on the other hand, is an atomic value. It has no parts. (The notation the programmer uses to designate this atomic value has four characters, but the value designated itself has no parts.) If you think this is all somewhat confusing, you're right. It gets easier with practice.

78 `'the` can also be written `(quote the)`. This is even more confusing, because here the `the` is not interpreted as a variable. (Try `(let* ((the 3)) (quote the))`.) If you come across `(quote the)`, just read it as a verbose (and perhaps misleading) way of writing `'the`, not as the application of any function to any value.

80 Okay, so what we've done is just create a bunch of new atomic values `'the`, `'man`, and so on. Scheme doesn't know how to do much with these. It knows for instance that `'the` is the same value as `'the` and a different value than `'man`. But it doesn't know much more than that. That's all we need or want here.

95 ---or as an equivalent shorthand. And although there aren't `'`s prefixed to each of the elements of this nested structure, those elements are still the `'the`, `'man` and so on primitive atomic values that we specified. Not the values (if any) possessed by some variables `the`, `man`, and so on.

123 Remember, in Scheme you can have functions that take one value, and also functions that take two values, and also functions that take zero values. The last ones are called "thunks." The thunk is not identical to the value it returns. For instance:

130 There's no reason yet on hand for us to make `damn` be a thunk. For present purposes, we could also just define `damn` to be the symbol `'id`. But what we're going to go on to do does require us to make `damn` be a thunk. The reason for that is to postpone the evaluation of some expressions until the continuations we want to operate on are in place. So for uniformity we're going to make `damn` be a thunk right from the beginning.

171 Which is not quite what we're looking for. We don't want to contribute the normal adjectival meaning of "bad" to the proposition asserted. Instead we want badness to be a side-issue linguistic contribution. We might try:

185 A promising way to handle this is with **continuations**, which you will get much more familiar with as this seminar progresses. Don't worry about not understanding what's going on quite yet. This is just an advertisement that's supposed to provoke your imagination.

200 In other words, `damn` is a thunk. When that thunk is applied---we evaluate `(damn)`---we capture the pending future of that application 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 as if `(damn)` had simply returned `'id`.

238 So the demonstration we tried in class was pedagogically flawed. It didn't properly display how continuations are a minimally effective apparatus for representing affective meaning. In fact, continuations *were* still doing the work, but it wasn't the explicit continuations we were writing out for you. It was instead continuations implicit in the `print` operation.

246 Instead of representing the side-issue affective contribution by printing "bad", let's instead try to build a pair of side-effect contributions and at-issue assertion. Then what we want would be something like:

268 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)`.

270 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.

276 The straightforward way to fix this is to use, not undelimited continuations, but instead a more powerful apparatus called "delimited continuations." These too will be explained in due course, don't expect to understand all this now.

278 A delimited continuation is captured not by using `call/cc`, but instead by using a variety of other operators. We'll use the operator `shift`. This substitutes for `call/cc`. The syntax in Scheme is slightly different. Whereas we wrote:

286 but the behavior is the same. It's just that now our continuation doesn't stretch until the end of the computation, but only up to some specified limit. The limit of the continuation is specified using the syntax:

290 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.

292 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.

308 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.