#lang racket (define p1-c #f) (define p1 (lambda () (call/cc (lambda (yield) ; yield control and return to caller (let ( (x 0) ) (set! x (+ x 1)) (display x) (newline) ; the first checkpoint (call/cc (lambda (c) (set! p1-c c) (yield x))) (set! x (+ x 1)) (display x) (newline) ; the second checkpoint (call/cc (lambda (c) (set! p1-c c) (yield x))) ; there is no third checkpoint! (set! p1-c (lambda () "Hey, I'm finished")) "done" ))) )) (p1) ; what happens if you uncomment this ; (p1-c)