On Tue, May 18, 2021 at 4:09 PM Philip McGrath <[email protected]>
wrote:

> On Tue, May 18, 2021 at 3:52 PM Sam Tobin-Hochstadt <[email protected]>
> wrote:
>
>> I think the key question is what you want to happen if you would need
>> to re-run the "pre" thunk, because you re-enter the code via a
>> continuation.
>>
>> In many cases, you don't want to support that at all …
>>
>
> Then you can use `call-with-continuation-barrier`, right?
>
> (let* ([conn (connect-to-server)])
>   (dynamic-wind
>    void
>    (λ ()
>      (call-with-continuation-barrier
>       (λ ()
>         (send-message conn "hi"))))
>    (λ ()
>      (finalize-connection conn))))
>
> I think I don't understand cwcb well enough to get this, but the connect
call is not in the pre thunk so it's not guaranteed to happen...right?

-- 
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/0100017981191578-b5eaa465-de2a-4f1f-a4f1-d2976db88de0-000000%40email.amazonses.com
> <https://groups.google.com/d/msgid/racket-users/0100017981191578-b5eaa465-de2a-4f1f-a4f1-d2976db88de0-000000%40email.amazonses.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKodVmpqrNQMhEiX2QOi-CTQkO_s96%3Dgdoks4wt93%2Bmxy6g%40mail.gmail.com.

Reply via email to