December 2021
Beginner
840 pages
47h 29m
English
This chapter is concerned with imparting control to a computer program. We used first-class continuations (captured, for example, through call/cc), tail recursion, and continuation-passing style to tease out ideas about control and how to affect it in programming. While evaluating an expression, the interpreter must keep track of what to do with the return value of the expression it is currently evaluating. The actions entailed in the “what to do with the return value” are the pending computations or the continuation of the computation. A continuation is a one-argument function that represents the remainder of a computation from a given point in a program. The argument passed to a continuation is the return value of the ...