"You are responsible for explicitly understanding the rest of the program." A sentence like this appears in every tutorial explaining first-class continuations, a programming language construct that appears in Lisp, Scheme, and Haskell, and if you look at people discussing them they find such constructs "scary."
One of the things I did many, many moons ago was write a couple of small Lisp
interpreters. (It was long enough ago that I'm
sorry to say they were written in CoffeeScript.) One thing that I did
finally understand while building these was how continuations could be used to replace almost all
flow control, that
while, and even function calls were all just specialized versions of
The problem with continuations is that they do look scary. But while watching Alexis King's awesome presentation Demystifying Delimited Continuations, I'm glad to say that I finally wrapped my head around the notation for continuations in a way that clarifies that terrifying sentence you find in every explanation of continuations, "A continuation is the code you write that will handle the rest of the program."