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

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Feb 21 22:18:31 EST 2007

On 2/21/07, Dimitris Vyzovitis <vyzo at media.mit.edu> wrote:
> On Wed, 21 Feb 2007, Robby Findler wrote:
>
> > No no - you misunderstand. Of course, that is the main technique for
> > all CML-style programs! Everyone knows that.
> >
> > When there is a single handle-evts, its proc should be called in tail
> > position wrt to the sync. But no one is proposing making all of them
> > in  tail-position wrt to the sync. That's not possible. (Matthew
> > proposed an error.)
>
> Uhm, I am not sure what you mean here.
> If there are non-handle-evts in the arguments to sync, then their
> procs are of course not in tail context, but with handle-evt terminal,
> then their procs are all in tail context even when there is many of them.
>
> (let lp ((blah #f))
>   (sync (handle-evt always-evt lp) (handle-evt always-evt lp)))
>
> should still be omega and
>
> (let ((end (alarm-evt (+ (current-time) 1000))))
>   (let lp ((blah #f))
>     (sync (handle-evt always-evt lp)
>           (wrap-evt end void))))
>
> should eventually evaluate to void without consuming any memory in the
> recursion.
>
> The point is to disallow (handle-evt (handle-evt ...) ...)
> That's what Matthew meant (I think :) and I don't see any error to it.

Matthew's "error" is only that he says that the above should be an
error in Scheme! :)

I'm saying that it should not be an error. I think it is useful and
should not be disallowed.

Robby


Posted on the users mailing list.