[racket-dev] chaperone-evt restrictions?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Aug 2 21:20:28 EDT 2013

At Fri, 2 Aug 2013 18:32:38 -0400, Asumu Takikawa wrote:
> I'm currently trying to implement contracts for synchronizable events.
> During that, I've discovered that there seems to be an undocumented
> restriction that `chaperone-evt` can only chaperone an event that is not
> a handle event. Here's an example:
>   -> (sync (chaperone-evt (handle-evt always-evt identity)
>                           (lambda (e) (values e identity))))
>   ; wrap-evt: contract violation
>   ;   expected: (and/c evt? (not/c handle-evt?))
>   ;   given: #<evt>
>   ; [,bt for context]

The restriction (which should have been documented) is there the same
reason as for `wrap-evt', since the procedure in place of `identity'
above gets to adjust the result of the event --- and so handling can't
be in tail position with respect to `sync'.

But I'm ready to throw out the `(not/c handle-evt?)' restrictions

Posted on the dev mailing list.