Linearly Used Continuations
- Josh Berdine ,
- Peter W. O'Hearn ,
- Uday S. Reddy ,
- Hayo Thielecke
Proceedings of the Third ACM SIGPLAN Workshop on Continuations (CW'01) |
Published by Technical Report No. 545, Computer Science Department, Indiana University | Organized by ACM SIGPLAN
Continuations are the raw material of control. They can be used to explain a wide variety of control behaviours, including calling/returning (procedures), raising/handling exceptions), labelled jumping (goto statements), process
switching (coroutines), and backtracking. In the most powerful form, represented by callcc and its cousins, the programmer can manipulate continuations as first-class values. It can be argued, however, that unrestricted use of continuations, especially when combined with state, can give rise to intractable higher-order spaghetti code. Hence, few languages give the user direct, reied, access to continuations; rather, they are \behind the scenes”, implementing other control behaviours, and their use is highly stylised.