Continuation Sandwich
I’ve often come across the word ‘Continuations’ in the programming language discussions but I never made up my mind to investigate what it means. Interestingly while reading up a bit about Ruby I hopped to this delicious description of ‘First-class continuations”:
“Say you’re in the kitchen in front of the refrigerator, thinking about a sandwich. You take a continuation right there and stick it in your pocket. Then you get some turkey and bread out of the refrigerator and make yourself a sandwich, which is now sitting on the counter. You invoke the continuation in your pocket, and you find yourself standing in front of the refrigerator again, thinking about a sandwich. But fortunately, there’s a sandwich on the counter, and all the materials used to make it are gone. So you eat it. :-)”
Source: Wikipedia