Hi,

On Mon, Oct 28, 2024, at 6:19 PM, Arthur A. Gleckler wrote:
> Marc Nieper-Wißkirchen, author of SRFI 248 
> <https://srfi.schemers.org/srfi-248/>: *Minimal delimited continuations*, has 
> agreed to announcing a *last call* for this SRFI.  He believes that it is 
> ready for finalization, but would like to get corrections and feedback before 
> we finalize it.  *Feedback from Scheme implementers and maintainers is 
> particularly welcome.*
> 

I have briefly looked at the document, sample implementation, and discussion.

One immediate question jumps out at me: what is the purpose of 
`empty-continuation?`? It doesn't seem to be implemented by the sample 
implementation or used in the test suite. Is it a necessary part of this SRFI? 
If an implementation provides built-in delimited continuations but doesn't 
provide `empty-continuation?` as a primitive, it seems like it might be 
difficult or inefficient to emulate.

I also want to clarify the semantics of `with-unwind-handler`. The 
specification says that the anonymous exception handler it installs "applies 
*handler* on *obj* and *k* in the continuation and dynamic environment of the 
call to `with-unwind-handler`." That seems to mean that the anonymous handler 
aborts to the prompt before applying *handler* (though after capturing *k*)—and 
indeed, that's what the the sample implementation seems to do. But it is subtly 
different than the R6RS `with-exception-handler`, where the handler in called 
in the dynamic environment of the call to `raise`, "except that the current 
exception handler is the one that was in place when the handler being called 
was installed" (plus details about the handler returning that differ for 
`raise` and `raise-continuable`).

(As an aside, I would love some clearer way to distinguish "handler" from the 
"anonymous handler.")

Based on the note in https://srfi-email.schemers.org/srfi-248/msg/25615855/, it 
sounds like the semantics should also clarify that *k* is a composable 
continuation.

Similarly, I'd like more precision about "the portion of the current 
continuation up to and including the call to `with-unwind-handler`". The use of 
"including" is confusingly similar to (but IIUC distinct from) the notion of 
continuation capture (not) including a prompt as in 
https://www-old.cs.utah.edu/plt/publications/icfp07-fyff.pdf:

> With respect to the many composable control operators in the
> literature, we have opted for a variant where capture does not
> include the delimiting prompt, and composition does not introduce
> a prompt. Previous work explores the design space related to this
> choice in depth (Shan 2004; Kiselyov 2005a; Biernacki et al. 2006;
> Dybvig et al. 2006); when taking into account space complexity,
> only the design that does not include or add a prompt is known to
> express the others (Dybvig et al. 2006).

Hope this is useful,
Philip

Reply via email to