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

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat Oct 15 13:11:56 EDT 2005

Eric Hanchrow wrote:
> 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.

For the record:

(load "foo.ss")
(require foo)

does what you want.

Jens Axel Søgaard

Posted on the users mailing list.