Chez Scheme Transcript [Wed May 16 11:21:31 2012] > (rep) ;;; Regular version of first code sample: >> (let ([x (call/cc (lambda (k) k))]) (x (lambda (ignore) 7))) 7 ;;; Let's define a global "c" and then add an expression ;;; in the let-expression to demonstrate that we indeed ;;; go back to the evaluation of the values of the let ;;; expression. Notice that in the example below, we will ;;; evaluate the begin expression twice as witnessed by the ;;; fact that c is now 3. >> (define c 1) # >> c 1 >> (let ([x (call/cc (lambda (k) k))] [y (begin (set! c (+ c 1)) 42)]) (x (lambda (ignore) 7))) 7 >> c 3 ;;; Similar to the above case, we will evaluate the the ;;; (lambda (x) x) twice: >> (((call/cc (lambda (k) k)) (lambda (x) x)) 7) 7 ;;; This is witnessed by the fact the c is again increased ;;; by two >> (set! c 1) # >> c 1 >> (((call/cc (lambda (k) k)) (begin (set! c (+ c 1)) (lambda (x) x))) 7) 7 >> c 3 ;;; The following code sample creates an infinite loop: >> ((lambda (x) (x x)) (call/cc (lambda (k) k))) ;;; Notice that I am -c'ing out of the infinite loop ;;; and then go back into my interpreter to verify this. ;;; c is now a big number. >> (set! c 1) # >> c 1 >> ((lambda (x y)(x x)) (call/cc (lambda (k) k)) (set! c (+ c 1))) break> r > (rep) >> c 6624