[racket-dev] Motivation for handle-evt/wrap-evt contracts

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Thu Jul 25 13:48:00 EDT 2013

Hi all,

I had a question about `handle-evt` and synchronizable events in
general. I was trying to understand the documentation and only have a
partial idea of the motivation behind `handle-evt` and the contracts of
`handle-evt` and `wrap-evt`.

In particular, what is the motivation for disallowing objects that
satisfy `handle-evt?` as an argument for `handle-evt` and `wrap-evt`?

As far as I understand, `handle-evt` allows more efficient
post-processing of a synchronization result because the handler is
called in tail position. However, it doesn't seem necessary to disallow
the addition of more handlers (with the caveat that the tail call
guarantee will disappear if this happens).

Am I missing something?

Note: I'm asking because these restrictions in the contracts complicate
the types that we need to assign in Typed Racket:


Posted on the dev mailing list.