[plt-scheme] reloading libraries

From: Phil Windley (phil at windley.org)
Date: Wed Jun 8 16:58:14 EDT 2005

In playing with the extensions I mentioned in my last email, I  
noticed a behavior in DrScheme that I don't think is right.

If I create a file that loads the extension and edit in DrScheme,  
clicking Run starts a new session in the interaction window, but the  
library is not reloaded.

To see this consider the following program:

#include "escheme.h"

Scheme_Object *scheme_initialize(Scheme_Env *env) {
return scheme_make_byte_string("hello world");

Scheme_Object *scheme_reload(Scheme_Env *env) {
return scheme_initialize(env); /* Nothing special for reload */

Scheme_Object *scheme_module_name() {
return scheme_false;

This will generate a dlopen error when you because make_byte_string  
is no longer defined.  Instead you have to use make_byte_string.   
Change it, recompile, relink, and then click run in the window that  
loads the extension.  You'll get the same error.  However, running it  
from mzscheme does not.    Even restarting DrScheme doesn't seem to  
clear the old library.  Is it being cached somewhere?


Posted on the users mailing list.