[plt-scheme] How do I reload a module that I've "require"d in the REPL?

From: Eric Hanchrow (offby1 at blarg.net)
Date: Sat Oct 15 11:31:20 EDT 2005

I bet this is a frequently-asked question, but of course I couldn't
find any answer ...

I'm using the mzscheme REPL (299.402 if it matters).  I'm tinkering
with a file foo.ss, which is a module (i.e., it looks like

        (module foo mzscheme
         (provide nifty)
         (define nifty ...)
I've done (require "foo"), but then I decided to edit foo.ss.  Now I'd
like to re-load the file, so that my changes show up in the REPL ...
but of course simply re-doing (require "foo.ss") has no effect.  Doing
(load "foo.ss") takes some time, so it seems as if it's doing
something ... but my changes don't appear (i.e., when I evaluate
"(nifty)", I get the old behavior).  Is there any easy way to get the
stuff reloaded?  I'd rather not use DrScheme, and I'd also rather not
entirely shut down, and then restart, the REPL.

Garbage collection, introduced by Lisp in about 1960, is now
widely considered to be a good thing.
        -- Paul Graham

Posted on the users mailing list.