Re: [racket-dev] More places questions
On Fri, Sep 30, 2011 at 12:26 AM, John Clements cleme...@brinckerhoff.org wrote: I'm guessing that calling place-channel-put with a descriptor pulls out the associated channel... should the docs indicate this? The docs here: http://pre.racket-lang.org/docs/html/reference/places.html?q=place#%28tech._place._descriptor%29 say that. Also, my tiny experiments suggest that place-channel-put is blocking, is that right? I think that's correct (like with `channel-put'), but the docs don't seem to say. -- sam th sa...@ccs.neu.edu _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] More places questions
place-channel-put is not blocking. I'll add it to the docs. On 09/30/2011 06:28 AM, Sam Tobin-Hochstadt wrote: On Fri, Sep 30, 2011 at 12:26 AM, John Clements cleme...@brinckerhoff.org wrote: I'm guessing that calling place-channel-put with a descriptor pulls out the associated channel... should the docs indicate this? The docs here: http://pre.racket-lang.org/docs/html/reference/places.html?q=place#%28tech._place._descriptor%29 say that. Also, my tiny experiments suggest that place-channel-put is blocking, is that right? I think that's correct (like with `channel-put'), but the docs don't seem to say. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] More places questions
A few minutes ago, Kevin Tew wrote: place-channel-put is not blocking. So channel in the name is not a good choice... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] More places questions
At Fri, 30 Sep 2011 09:21:42 -0400, Eli Barzilay wrote: A few minutes ago, Kevin Tew wrote: place-channel-put is not blocking. So channel in the name is not a good choice... We use channel for asynchronous channels, too, such as `racket/asynch-channel'. Since all place channels are asynchronous, I think it would be redundant to include `async' in the name. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] More places questions
On Sep 30, 2011, at 6:31 AM, Matthew Flatt wrote: At Fri, 30 Sep 2011 09:21:42 -0400, Eli Barzilay wrote: A few minutes ago, Kevin Tew wrote: place-channel-put is not blocking. So channel in the name is not a good choice... We use channel for asynchronous channels, too, such as `racket/asynch-channel'. Since all place channels are asynchronous, I think it would be redundant to include `async' in the name. I see that it's not blocking... there's something else fishy going on, though. This program: #lang racket (define (main) (define p (place ch (thread (lambda () (place-channel-put ch 'letter-to-myself))) (define result (place-channel-get ch)) (printf got a result: ~s\n result))) 3) ...doesn't print anything out. This suggests that place-channels are unlike regular ones, in that they refer to a different channel when used with channel-put than they do when used with channel-get. I'm not sure how I would clarify the docs here. John smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] More places questions
On Sep 30, 2011, at 5:28 AM, Sam Tobin-Hochstadt wrote: On Fri, Sep 30, 2011 at 12:26 AM, John Clements cleme...@brinckerhoff.org wrote: I'm guessing that calling place-channel-put with a descriptor pulls out the associated channel... should the docs indicate this? The docs here: http://pre.racket-lang.org/docs/html/reference/places.html?q=place#%28tech._place._descriptor%29 say that. They do indeed; specifically, they say Every place descriptor is also a place channel. But in that case, I think that this program: #lang racket (define (main) (define p (place ch 3)) (place-channel? p)) ... should produce #t, but it produces #f. No? John smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] More places questions
Yeah I think you are right. I'll commit a change. Kevin On 09/30/2011 03:17 PM, John Clements wrote: On Sep 30, 2011, at 5:28 AM, Sam Tobin-Hochstadt wrote: On Fri, Sep 30, 2011 at 12:26 AM, John Clements cleme...@brinckerhoff.org wrote: I'm guessing that calling place-channel-put with a descriptor pulls out the associated channel... should the docs indicate this? The docs here: http://pre.racket-lang.org/docs/html/reference/places.html?q=place#%28tech._place._descriptor%29 say that. They do indeed; specifically, they say Every place descriptor is also a place channel. But in that case, I think that this program: #lang racket (define (main) (define p (place ch 3)) (place-channel? p)) ... should produce #t, but it produces #f. No? John _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] More places questions
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 smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev