<div dir="ltr">Sure, they are collected. This returns #f when I run it for the last result.<div><br></div><div><div>#lang racket</div><div>(define TMP (make-base-namespace))</div><div>(define wb (make-weak-box TMP))</div><div>
(parameterize ([current-namespace TMP])</div><div> (namespace-require 'racket)</div><div> (eval '(length (list 1 2 3))))</div><div>(set! TMP #f)</div><div>(collect-garbage)</div><div>(weak-box-value wb)</div></div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Feb 9, 2013 at 6:50 PM, Ray Racine <span dir="ltr"><<a href="mailto:ray.racine@gmail.com" target="_blank">ray.racine@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The API is pretty flexible about creating and loading modules into namespaces. What is not apparent is how to evict a namespace or the GC-ableness of a namespace.<div>
<br></div><div>In the REPL, topleve.</div>
<div><br></div><div>Say I in a scope of code, I create a base namespace I'll call TMP, load or attach modules into it, switch to it via current-namespace. </div><div><br></div><div>Now say I switch the current-namespace to some other namespace, maybe the original I saved before I created TMP. At the top-level, to me, there is no reference to TMP. Will TMP be GC'd? Or is there away to explicitly "purge" an unused namespace?<br>
</div><div><br></div><div>Thanks,</div><div><br></div><div>Ray</div></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>