plt/racket — pull request #379 by takikawa (2013-07-02 22:52:08+00:00)
Title: Add support for synchronizable events

This pull request is for code review.

Something in particular that would be nice to have more eyes look at is subtyping. Is covariant subtyping okay for `evt?` types? I think it is, because there's no way to "write" to an `evt?` value. If you cast a writable channel to an event, it should be impossible to recover the ability to write to it.

Also, this doesn't allow typed-untyped interoperation yet since there are no contracts for events AFAICT. Since there are event chaperones, it should be possible to implement those in the future.

Finally, what type should `wrap-evt` have? It requires that its input not be a `handle-event?`, but I don't think the type system can encode that. If we're ok with `wrap-evt` producing an error in this case (like how `car` errors on empty lists), we could give it a type.