[racket-dev] request: replace-evt

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jul 8 00:36:55 EDT 2014

Hi Jan,

That's a nice idea. Something similar --- but in a restricted form ---
is used internally to implement various primitive events. I think I see
how to generalize it to work with more arbitrary events and non-atomic
replace functions.

There could easily be a catch that I'm overlooking, but I'll give it a


At Mon, 07 Jul 2014 22:41:55 +0200, Jan Dvořák wrote:
> Hi,
> I would like to humbly request a new `replace-evt` procedure that would
> work as `wrap-evt` except that when it produces another `evt?`, `sync`
> replaces the old event with the newly produced one and restarts.
> It will be a good replacement for threads and channels when filtering
> events or addition of bookkeeping handlers is desired.
> I peeked at the syncing code and it seems doable, but the code is too
> dense for me to grok it. :-(
> What do you think?
> Best regards,
> Jan Dvorak
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev

Posted on the dev mailing list.