Introduction to Delimited Continuations/The rest of the program

When the program reads a line from the console, something interesting has happened. The flow of the program has been interrupted, and it cannot proceed until the user has typed a line of text. The rest of the program is now a function which takes a  and prints a message to the console, and is invoked only when the user has provided input.

The "rest of the program" is a continuation, and looks like this:

The  method can be rearranged to invoke the continuation once the user has typed a line of text.


 * Next Lesson
 * Course Home Page