On Wednesday, January 24, 2018 at 5:54:44 PM UTC-5, Alexis King wrote:
>
> Based on your question, why not just use dynamic-wind in combination 
> with with-handlers? Just keep in mind that the post-thunk could be 
> called multiple times if there is a continuation jump into value-thunk, 
> so you should also wrap the whole thing with 
> call-with-continuation-barrier if it’s important that the post-thunk 
> only be executed once. 
>
> Alexis 
>

I was thinking about using `dynamic-wind` but indeed was worried about 
post-thunk being called multiple times. Wrapping with 
`call-with-continuation-barrier` sounds like the right thing to do.

Additionally, the note from Matthias lead me to realize that 
`call-with-exception-handler` is supposed to receive an actual thunk as its 
second argument and `with-handlers` most definitely isn't one. Moving it 
into a thunk resolved the problem so that means in my erroneous code 
`with-handlers` was being evaluated before `call-with-exception-handler` 
even has a chance to install the handler and see the raised exceptions.

Now I just have to think some more about which avenue I want to use.

Thank you for your suggestion!

-- 
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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to