[racket-dev] weak boxes in a script

2011-03-16 Thread David Vanderson
I'm seeing a difference between when the value in a weak box is collected. When I run the following interactively, the value is collected like I expect. But it is not collected when running in a script, or in DrRacket. This is v5.1 on Ubuntu x64, compiled from source. Can someone explain

Re: [racket-dev] weak boxes in a script

2011-03-16 Thread Carl Eastlund
David, I believe you are seeing the difference between modules and the REPL. At the REPL, each expression is compiled, run, and discarded. This yields the behavior you expect. But a #lang form produces a module, which is compiled and kept for the rest of the session. Thus, even after garbage

Re: [racket-dev] weak boxes in a script

2011-03-16 Thread David Vanderson
Thanks so much, that makes perfect sense. On 03/16/2011 02:16 PM, Carl Eastlund wrote: David, I believe you are seeing the difference between modules and the REPL. At the REPL, each expression is compiled, run, and discarded. This yields the behavior you expect. But a #lang form produces a