Hello everyone,<div><br></div><div>I am not that good with continuations, and am having trouble accomplishing what I want - which is quite trick. A little help and wisdom would be greatly appreciated.</div><div><br></div><div>
<div>(define-special-computation-block</div><div>  (let ((i 0))</div><div>    ... computation block 1 ...</div><div>    (yield) ;;suspend computation</div><div>    (set! i 1)</div><div>    ... computation block 2 ...</div>
<div>    (yield) ;;suspend computation</div><div>    (set! i 2)</div><div>    ... computation block 3 ...</div><div>    (yield) ;;suspend computation</div><div>    (set! i 3)))</div></div><div><br></div><div>The above code defines a piece of computation that can be suspended and resumed, and I got that part of it working properly using call/cc. However the computation also carries some state: the i variable. I would like to &quot;save&quot; the state of the computation after computation block 1, such that I can resume it from there over and over with i still equal to 0. Is this possible using portable R6RS scheme? </div>
<div><br></div><div>Thanks very much for your help!</div><div>  -Patrick</div>