[plt-scheme] Reloading code

From: Curt Ferguson (curtferguson at cfl.rr.com)
Date: Sun Mar 2 08:28:02 EST 2008

>
> It's possible to re-declare modules. If those modules are
> participating in a program (that is, they've been invoked), then when
> you redeclare the module, the new version is invoked and its exports
> override the previous exports. For this to happen, you'll need to set
> the 'compile-enforce-module-constants' parameter to #f before you load
> any module that you may eventually want to reload. See the section of
> the reference on "Module Re-declarations".
>
> One main caveat (among several caveats I could list): If you reload a
> module that declares structs, then you'll generate entirely new
> structure types and you'll redefine the names of the constructors,
> predicates, and accessors to work only on the new versions. If you
> have instances of the old structure types floating around, things will
> get weird.
>
> Consider whether you really want to reload modules the way you
> described. You might be able to get what you want by setting up your
> code to use parameters or boxes or whatnot and updating those when you
> want to change the behavior of your program.
>
> **
>
Thanks for the replies.  Ryan I appreciate the example, Matthias thanks
for the reference, I'll look into the web server in the next couple
days.  My copy of "The Little Schemer" arrived today so I'll be spending
a bit of time with that.




Posted on the users mailing list.