Hi,
I recently test a piece of code written using call/cc on Guile and several
other Scheme implementations, but get different results. The code piece is
as follows:
(let ((n 0)
(c (call/cc (lambda (k) k))))
(display n)
(newline)
(set! n (+ n 1))
(c c))
What I wanna do is try to print out the sequence of natural numbers using
call/cc. On Guile, it works well. But other implementations (Chicken,
Bigloo, Racket) all print out (an infinite sequence of) 0. I am puzzled. Any
idea?
--
DAY
