So, to clarify for my sake, is it safe to say that places should never be created at the top level of any module (I haven't really looked into how dynamic places work, so this statement may not apply there)? For instance, when I wrap the previous top-level code in a module+ main, I get a contract violation, but when I put it in a function like Matthew's code, it works fine.<br>
<br><div class="gmail_quote">On Thu, Oct 18, 2012 at 6:21 AM, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That's right, and it's awkward, but it's not broken in the sense of an<br>
overlooked mistake in the implementation. It's the intended semantics<br>
--- the best we know how to implement, for now.<br>
<br>
I use a `main' submodule to avoid creating too many places:<br>
<br>
#lang racket<br>
<br>
(define (go)<br>
(place-wait (place x (system "touch /tmp/file"))))<br>
<br>
(module+ main (go))<br>
<br>
It seems like there should a nicer syntactic form for this pattern, but<br>
I haven't found one that I like enough to recommend.<br>
<div class="im HOEnZb"><br>
At Thu, 18 Oct 2012 10:05:19 +0200, Tobias Hammer wrote:<br>
> The whole enclosing module (file) is executed again on every call to place.<br>
> Add a print before the place start to see it. Seems to be broken since <<br>
> 5.2.1.<br>
><br>
> On Thu, 18 Oct 2012 06:39:56 +0200, Nick Shelley <<a href="mailto:nickmshelley@gmail.com">nickmshelley@gmail.com</a>><br>
> wrote:<br>
><br>
> > It looks like that was the problem. Thanks!<br>
> ><br>
> > However, if I add (place-wait p) after defining p as the place, DrRacket<br>
> > runs out of memory (and never prints anything), while Racket gives a<br>
> > "place: scheduler pipe failed" error and runs the place body about 50<br>
> > times. Anything else obvious I'm missing?<br>
<br>
</div><div class="HOEnZb"><div class="h5">____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br>