There is one abstraction that can be used to implement such apparently diverse concepts as exceptions, generators, coroutines and even the backtracking mechanism present in Prolog. This article demonstrates how to use continuations to implement these constructs in a custom, small programming language. Then the implementation of an interpreter for that language is presented. Finally a Java servlet
![Continuations](https://cdn-ak-scissors.b.st-hatena.com/image/square/b7c09fad234047717f6124209bba197831656b0a/height=288;version=1;width=512/https%3A%2F%2Fcuriosity-driven.org%2Fassets%2Fce789f14%2Fthumbnails%2Fcontinuations.png)