30 ms·
> I did not like that undelimited continuations were not mentioned. call/cc continuations are undelimited continuations right? It sounds like you're talking ab
by hencq 5y ago
> I did not like that undelimited continuations were not mentioned.
call/cc continuations are undelimited continuations right? It sounds like you're talking about call/ec, escape continuations or one-shot continuations. They're essentially longjmp in C.
- compressedgas 5y agoI meant delimited. However copy and paste had other plans. All of call/cc, call/ec, call/1cc are effectively jumps to a saved stack. (The difference between these is that the first can be used more than once and both to enter and exit. The second can only be used to exit. The third can only be used once.) shift is instead captures the return stack up to the first reset and forms a function out of it that when called runs the rest of each of the frames before returning to the caller of that created function.