Last call for comments on SRFI 248: Minimal delimited continuations Arthur A. Gleckler (28 Oct 2024 22:19 UTC)
Re: Last call for comments on SRFI 248: Minimal delimited continuations Marc Nieper-Wißkirchen (29 Oct 2024 12:49 UTC)
Re: Last call for comments on SRFI 248: Minimal delimited continuations Marc Nieper-Wißkirchen (29 Oct 2024 14:01 UTC)
Re: Last call for comments on SRFI 248: Minimal delimited continuations Marc Nieper-Wißkirchen (29 Oct 2024 15:07 UTC)

Re: Last call for comments on SRFI 248: Minimal delimited continuations Marc Nieper-Wißkirchen 29 Oct 2024 14:01 UTC

As I didn't test the code I posted, of course, I introduced a mistake:

[...]

> Note that when K^ is the empty continuation in the sense of SRFI 248,
> the code above builds unnecessary objects.  A version without a space
> leak is thus:
>
> (app-second
>   (guard
>       (c k^
>         (else
>           (let ((k (if (empty-continuation? k^) k^ (lambda (x) (app-first (k^ x))))))
>             (values
>               (lambda () (k (raise-continuable c)))
>               (lambda () H)))))
>     (let ((v E))
>       (values
>         (lambda () v)
>         (lambda () v)))))

Please replace the condition

(if (empty-continuation? k^) k^ (lambda (x) (app-first k^ x)))

with

(if (empty-condition? k^) values (lambda (x) (app-first (k^ x))))

PS I am going to add one more comment later.