4 ms·
If you want multishot continuations then I don't really know of any way other than delimited continuations (other than undelimeted continuations or simulating d
by tome 1y ago
If you want multishot continuations then I don't really know of any way other than delimited continuations (other than undelimeted continuations or simulating delimited continuations, on the heap).
- cryptonector 1y agoWhy can't the handler be invoked as if it was called from the effect invocation site, then return? But apart from that and to answer your question there is an alternative to delimited continuations, and that's undelimited continuations (which essentially requires allocating call frames on the heap).
- Rusky 1y agoThe handler doesn't have to follow the pattern of "do its work, resume the computation, go away." It can instead do things like "do some work, resume the computation, do some more work." Or even more invasively, "stash the computation somewhere, return from the handler site, let the rest of the program run for a while, then resume the computation."
- tome 1y ago> Why can't the handler be invoked as if it was called from the effect invocation site, then return? Then it would just be (equivalent to) a function call.