Steps:<div><br></div><div>1. Open DrRacket</div><div>2. In the definitions window, paste in</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><div>#lang racket</div>
<div><br></div><div>(define (super-simple)</div><div> (define p</div><div> (place ch</div><div> (place-channel-put ch 5)))</div><div> (place-channel-get p))</div></div></div></blockquote>3. Click the "Run" button in the toolbar<div>
4. In the REPL, type "(super-simple)"</div><div><br></div><div>The call to provide is necessary when loading code in the Terminal, but it doesn't seem necessary with DrRacket. In fact, based on the comment I saw in IRC about DrRacket reloading the module, I wonder if that has something to do with it. (although I'm new enough to Racket to not put much stock in my intuitions)</div>
<div><div><br></div></div><div>— Dave<br><div><br><div class="gmail_quote">On Tue, Aug 30, 2011 at 7:19 AM, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I'm not seeing bad behavior so probably I'm doing something slightly differently than you, which is making the difference. If you have the energy to send a precise set of steps I'm happy to try them on my machine and maybe that'll help us sort it out.<br>
<font color="#888888">
<br>Robby</font><div><div></div><div class="h5"><br><br>On Tuesday, August 30, 2011, David Mitchell <<a href="mailto:dave@fallingcanbedeadly.com" target="_blank">dave@fallingcanbedeadly.com</a>> wrote:<br>> I tried saving the module and putting a require in the DrRacket window, and that works correctly. I think this will be an acceptable workaround for the time being, but I'd really like to know more about what's going on.<br>
><br>> -- Dave (on the iPhone)<br>><br>> On Aug 30, 2011, at 4:44 AM, Robby Findler <<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>> wrote:<br>><br>>> I'm sorry; I was wrong.<br>
>><br>>> I don't see the behavior you're seeing, tho. If I add parens around<br>>> 'all-defined-out', and save the file in tmp.rkt, then this is the<br>>> behavior I see at the command-line racket:<br>
>><br>>> Welcome to Racket v5.1.3.6.<br>>>> (require "tmp.rkt")<br>>>> (super-simple)<br>>> 5<br>>><br>>> and I see similar behavior in DrRacket:<br>>><br>>> Welcome to DrRacket, version 5.1.3.6--2011-08-25(7bb8c6c4/d) [3m].<br>
>> Language: racket; memory limit: 128 MB.<br>>>> (super-simple)<br>>> 5<br>>>><br>>><br>>> FWIW, in 5.1.3, I get an error that's surprising to me, as I don't see<br>>> how the sandbox gets involved in this program, but here it is:<br>
>><br>>> car: expects argument of type <pair>; given '#((module program racket/base))<br>>><br>>> === context ===<br>>> /Applications/Racket v5.1.3/collects/racket/sandbox.rkt:572:17: ns<br>
>> /Applications/Racket v5.1.3/collects/racket/sandbox.rkt:584:20<br>>> /Applications/Racket v5.1.3/collects/racket/sandbox.rkt:334:0: call-with-limits<br>>> /Applications/Racket v5.1.3/collects/racket/sandbox.rkt:564:0: evaluate-program<br>
>> /Applications/Racket<br>>> v5.1.3/collects/racket/private/more-scheme.rkt:151:2:<br>>> call-with-break-parameterization<br>>> /Applications/Racket v5.1.3/collects/racket/sandbox.rkt:704:2: user-process<br>
>> /Applications/Racket v5.1.3/collects/mred/private/wx/common/queue.rkt:430:6<br>>> /Applications/Racket v5.1.3/collects/mred/private/wx/common/queue.rkt:470:32<br>>><br>>> Robby<br>>><br>>> On Mon, Aug 29, 2011 at 8:55 PM, David Mitchell<br>
>> <<a href="mailto:dave@fallingcanbedeadly.com" target="_blank">dave@fallingcanbedeadly.com</a>> wrote:<br>>>> You might have to unpack that a little bit more for me, as I don't see how that's the case. Additionally, why would it work from Terminal and not DrRacket?<br>
>>><br>>>> -- Dave (on the iPhone)<br>>>><br>>>> On Aug 29, 2011, at 6:32 PM, Robby Findler <<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>> wrote:<br>
>>><br>>>>> I think what's happening is that you're creating a place whose first<br>>>>> action is to create that same place again (over and over).<br>>>>><br>>>>> Robby<br>
>>>><br>>>>> On Mon, Aug 29, 2011 at 8:17 PM, David Mitchell<br>>>>> <<a href="mailto:dave@fallingcanbedeadly.com" target="_blank">dave@fallingcanbedeadly.com</a>> wrote:<br>>>>>> I've been trying to experiment with racket/place, but it seems to have<br>
>>>>> significant incompatibilities with DrRacket. I've defined a module based on<br>>>>>> a code snippet in <a href="http://www.cs.utah.edu/plt/publications/dls11-tsffd.pdf" target="_blank">http://www.cs.utah.edu/plt/publications/dls11-tsffd.pdf</a><br>
>>>>> that looks like this:<br>>>>>><br>>>>>> #lang racket<br>>>>>> (provide all-defined-out)<br>>>>>> (define (fib n)<br>>>>>> (define (fib-inner n-remaining i i+1)<br>
>>>>> (if (= n-remaining 1)<br>>>>>> i+1<br>>>>>> (fib-inner (- n-remaining 1) i+1 (+ i i+1))))<br>>>>>> (if (<= n 0)<br>>>>>> 0<br>
>>>>> (fib-inner n 0 1)))<br>>>>>> (define (start-fib n)<br>>>>>> (define p<br>>>>>> (place ch<br>>>>>> (define n (place-channel-get ch))<br>
>>>>> (place-channel-put ch (fib n))))<br>>>>>> (place-channel-put p n)<br>>>>>> p)<br>>>>>> (define (super-simple)<br>>>>>> (define p<br>
>>>>> (place ch<br>>>>>> (place-channel-put ch 5)))<br>>>>>> (place-channel-get p))<br>>>>>><br>>>>>> If I run racket in my Terminal and load this module, I'm able to use<br>
>>>>> start-fib and super-simple as expected. However, if I define this module in<br>>>>>> the DrRacket editor and access the functions through the repl, attempts to<br>>>>>> rec
</div></div></blockquote></div><br></div></div>