[racket] Places, Channels as Events. Labeling Places.

From: David T. Pierson (dtp at mindstory.com)
Date: Fri Dec 14 01:25:36 EST 2012

On Thu, Dec 13, 2012 at 03:34:36PM -0700, Jay McCarthy wrote:
> You want handle-evt
> 
> On Thu, Dec 13, 2012 at 3:27 PM, Ray Racine <ray.racine at gmail.com> wrote:
> > Using a Place or a Place-Channel as a sync event returns the value of a
> > place-channel-get and not the Place itself.
> >
> > Most events return the actual `thing' which one sync'd on.  This is not true
> > with places and channels, one gets the message itself.
> 
> I don't think it's true of "most" events. Other channels and some
> ports do the same thing.

I've wondered about this.  What is the rational behind these
differences?  Wrapping events is cumbersome.

For instance, my first intuition is that the synchronization result of a
place channel would be the place channel itself, just like the
synchronization result of a thread is the thread itself.  Why aren't
these analogous?

David


PS. As an aside, the documentation for handle-evt [1] states:

  Like wrap, except that ...

I suspect it is supposed to be:

  Like wrap-evt, except that ...

[1] http://docs.racket-lang.org/reference/sync.html?q=handle-evt#(def._((quote._~23~25kernel)._handle-evt))

Posted on the users mailing list.