Introduction to Delimited Continuations/Using shift and reset

Let's rewrite  using Scala's delimited continuations primitives,   and.

The flow of the program has not changed. Printing the second message to the screen becomes a continuation of type, which is passed into the   block as the function  , to be invoked with the user's input.


 * Next Lesson
 * Course Home Page