On Sun, Oct 9, 2022 at 3:58 AM Marc Nieper-Wißkirchen <marc.nie...@gmail.com> wrote:
> Am So., 9. Okt. 2022 um 15:26 Uhr schrieb Shiro Kawai < > shiro.ka...@gmail.com>: > > The following would not work: > > (define g > (make-coroutine-generator > (lambda (yield) > (unwind-protect > (begin > (yield 1) > (yield 2)))))) > (generator->list g) > > I think it's ok for the above not to work. My concern is more like this one: (let ((p (make-parameter 0))) (define g (make-coroutine-generator (lambda (yield) (parameterize ((p 1)) (yield p) (yield p))))) (unwind-protect (parameterize ((p 2)) (list (g) (g))) ) If parameterize is realized with dynamic-wind, can this work? > You mean dynamic-lambda from SRFI 154? That should be considered > subsumed and deprecated by SRFI 226. (I should ask Arthur to withdraw > it when SRFI 226 is finalized.) Your question seems to be less about > composable continuations, and more about dynamic-lambda. Yes, I meant srfi-154. What I'm trying to do is to undersand composable continuations wrt dyanmic environment. Initially I thought it's like a variation of delimited continuations, but seems that there's a subtle difference so I have to follow the srfi explanation more closely.