A continuation is like a special kind of pause button that lets you save where you are and come back to it later.
Imagine you're playing with building blocks, making a tower. You get to the top, but then your friend calls you for a game of hide-and-seek. Instead of knocking down your tower, you press the pause button, that's a continuation, so you can go play and come back to finish your tower whenever you want.
Like a Bookmark in a Storybook
Think of it like a bookmark in a storybook. You're reading your favorite story, and when you get to a good part, you put the bookmark there. Later, you pick up the book again and start right where you left off, just like with a continuation.
A Real-Life Example
Let’s say you’re eating ice cream. You take one scoop, then your mom calls you for help cleaning up. Instead of throwing away the rest of your ice cream, you save it for later, that's like using a continuation in real life!
So next time you pause something and come back to it, remember: you're using a continuation, just like in programming!
Examples
- A continuation is like a bookmark in a story, you can pick up where you left off later.
- If a function pauses to do something else, it can come back to where it left off using a continuation.
Ask a question
See also
- What are persistent data structures?
- What on Earth is Recursion? - Computerphile?
- How did a computer scientist use differential equations for Apollo missions?
- How do computer fonts work?
- How Can A Single Bit Of Information Change The World?