5 ms·
Does anyone have a good link to the state of the modern thinking on continuations? I remember from back in the Scheme R5RS era there was a conflict between cal
by oddthink 7y ago
Does anyone have a good link to the state of the modern thinking on continuations?
I remember from back in the Scheme R5RS era there was a conflict between call/cc and dynamic-wind.
If you have a dynamic extent (like for example a try {} finally {} block that does resource allocation/deallocation), and you exit, but then jump back into the block, how far do you try to re-wind the state? You probably don't re-open files, but you would probably want to re-set any dynamic-scoped variables.
I don't remember seeing this raised as an issue recently, so it must have been solved somehow, and I'm just wondering how.
- ghusbands 7y agoDynamic-wind was created to tame call/cc and exceptions, rather than being in conflict with it. It directly provides the facilities for re-re-setting things when you re-enter a left scope. However, you might want to look up delimited continuations as a different approach to similar kinds of control flow.
- oddthink 7y agoYes, thank you. I was thinking of Kent Pitman's critique that unwind-protect didn't have the right semantics when implemented with dynamic-wind, and that (in general) it seemed like fluid-let and unwind-protect wanted different sorts of continuations to implement them. (And now I need to go read more about one-shot vs multi and delimited continuations.) Someone (I forget who) had a critique about dynamic-wind itself that (IIRC) involved capturing continuations from within the before- and after-thunks of dynamic-wind, but that seems more like an edge case.
- firethief 7y agoNothing is right about call-cc: http://okmij.org/ftp/continuations/against-callcc.html http://okmij.org/ftp/continuations/against-callcc.html