[racket] Compiling a program with places
Matthew Flatt <mflatt at cs.utah.edu> írta:
>At Thu, 13 Oct 2011 06:43:19 +0200 (CEST), Ivanyi Peter wrote:
>> I would like to experiment with "places" in DrRacket. I have seen
>> the examplein the manual and I understand it. I have tried to execute it in
>> DrRacket but it says "no support".
>
>What platform and version are you using? Places should be enabled by
>default since 5.1.2 on most platforms.
I am on Windows XP and Version 5.1. But it seems I have to download a newer version.
>> My other (more
>> important) question is how can I turn the example problem into 1 or 2
>> executable. Is there any way for this?
>
>Are you looking at the example
>
> (let ([pls (for/list ([i (in-range 2)])
> (dynamic-place "place-worker.rkt" 'place-main))])
> (for ([i (in-range 2)]
> [p pls])
> (place-channel-put p i)
> (printf "~a\n" (place-channel-get p)))
> (map place-wait pls))
>
>and wondering how to replace the "place-worker.rkt" with something that
>works in an executable? Use `define-runtime-module-path'.
>
>Another possibility is to use the `place' form instead of
>`dynamic-place'. The new Guide section (which I see is not linked as it
>should be from the Reference section) provides an example using
>`place':
>
>http://pre.racket-lang.org/docs/html/guide/performance.html#(part._effective-places)
Thanks. I will try it and get back.
Peter Ivanyi