Project

General

Profile

Bug #1302 » testcallcc.scm

Sarwen (Christophe Calves), 03/20/2009 01:27 AM

 
(define call/cc call-with-current-continuation)

(define savecont "nil")

(define x (call/cc (lambda (k0)
(let ((r0 (map (lambda (x) (call/cc (lambda (k1)
(let ((r1 (lambda (y) (call/cc (lambda (k2)
(set! savecont k2)
(k1 y)
)))
))
(k0 r1)
)))
)
'(0)
)
))
(savecont r0)
))))



(define x1 (x 1))
(define x2 (x 2))
(define x3 (x 3))

(display "\nx1 = ")
(display x1)

(display "\nx2 = ")
(display x2)

(display "\nx3 = ")
(display x3)

(display "\n\n")

(2-2/3)