#lang racket (define x 0) ; shared state (define p1-c #f) (define p1 (lambda () ; set up a yield continuation (call/cc (lambda (yield) (do () (#f) ; a do forever loop (set! x (+ x 1)) (display x) (newline) (call/cc (lambda (c) (set! p1-c c) (yield x))) ))) ) ; yield gets us here ) ; define the checkpoint continuations (p1) ; what happens when we uncomment this ;(p1-c)