Hello everyone,<div><br></div><div>Does anyone know of a guide on how delimited continuations (reset/shift) can be implemented using a CPS transform? There is a paper for doing this in Scala, but I don't have a CS background and cannot understand the notation. </div>
<div><br></div><div>I thought it might be similar to implementing full continuations using a CPS transform (which I know how to do), but I'm not sure if my solution is the cleanest. Normally, in the CPS transform, each function is extended to take an extra continuation argument. My solution is to extend every function with an additional return-to-reset continuation on top of the extra continuation argument. This 2nd continuation is used by "shift" commands to return to the enclosing "reset", and the original 1st continuation is used to return to the caller.</div>
<div><br></div><div>Does that sound sensible?</div><div><br></div><div>Thanks</div><div> -Patrick</div>