<!-- GOTCHAS?? -->
+-- cutting for control operators --
+
3. `callcc` was originally introduced in Scheme. There it's written `call/cc` and is an abbreviation of `call-with-current-continuation`. Instead of the somewhat bulky form:
(call/cc (lambda (k) ...))
'(2 2 . #<procedure>)
+-- end of cut --
+
Ok, so now let's see how to perform these same computations via CPS.
In the lambda evaluator:
<!-- FIXME -->
+-- cutting following section for control operators --
+
Some callcc/letcc exercises
---------------------------
`snapshot` here corresponds to the code outside the `reset`. `continue_normally` is the middle block of code, between the `shift` and its surrounding `reset`. This is what gets bound to the `k` in our `shift`. The `if...` statement is inside a `shift`. Notice there that we invoke the bound continuation to "continue normally". We just invoke the outer continuation, saved in `snapshot` when we placed the `reset`, to skip the "continue normally" code and immediately abort to outside the box.
+
+-- end of cut --
+
+
Using `shift` and `reset` operators in OCaml, this would look like this:
#require "delimcc";;
* Sabry, "Note on axiomatizing the semantics of control operators" (1996)
+-- cutting some of the following for control operators --
+
Examples of shift/reset/abort
-----------------------------