[plt-scheme] handle-evt can wrap handle-evt

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Feb 21 16:42:45 EST 2007

At Wed, 21 Feb 2007 07:00:44 -0500 (EST), Dimitris Vyzovitis wrote:
> It seems that it is legal for a handle-evt to wrap another handle-evt.
> Aren't handle-evts supposed to be terminal events, that cannot be further
> wrapped?

I'll have to think about this one.

Currently, the docs for `handle-evt?' are incorrect, because they say
that `handle-evt' does not accept events produced by `handle-evt'. (The
docs for `handle-evt' mention no such prohibition, unlike the docs for

But maybe MzScheme should change in this case. Obviously, the inner
event's handler is not called in tail position with respect to the
event's synchronization.

In the implementation, the key prohibition is against wrapping a handle
event by `wrap-evt', because breaks have to be disabled in a particular
way when the outer event's wrapper is called. Allowing `handle-evt' on
other handle events doesn't create any trouble in the implementation,
but it does seem to violate the intent of handle events.

Unless I can remember (or think of) a reason why nesting `handle-evt's
should be allowed, I'll change MzScheme.


Posted on the users mailing list.