13.12 Chapter Summary
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access