Emulating GOTO in Scheme with continuations

In his 1968 letter, A case against the GO TO statement (known only by that name), Dijkstra said “[t]he go to statement as it stands is just too primitive, it is too much an invitation to make a mess of one’s program.” Unfortunately, scheme programmers aren’t given that invitation. That’s no fair! Fortunately, scheme has a procedure, call/cc , that we can use to emulate the style of control flow…