[racket-dev] More places questions

From: John Clements (clements at brinckerhoff.org)
Date: Fri Sep 30 00:26:12 EDT 2011

The example in the guide works fine:

#lang racket
 
(provide main)
 
(define (any-double? l)
  (for/or ([i (in-list l)])
    (for/or ([i2 (in-list l)])
      (= i2 (* 2 i)))))
 
(define (main)
  (define p
    (place ch
      (define l (place-channel-get ch))
      (define l-double? (any-double? l))
      (place-channel-put ch l-double?)))
 
  (place-channel-put p (list 1 2 4 8))
  (begin0
   (place-channel-get p))
   (place-wait p))

... which is strange, because 'p' is not a place-channel, and yet the call to (place-channel-put p (list 1 2 4 8)) succeeds.  I'm guessing that calling place-channel-put with a descriptor pulls out the associated channel... should the docs indicate this?

Also, my tiny experiments suggest that place-channel-put is blocking, is that right?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20110929/3f7039b6/attachment.p7s>

Posted on the dev mailing list.