[racket-dev] Shared-instantiation modules

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Fri Sep 10 18:39:39 EDT 2010

On 09/10/2010 04:04 PM, John Clements wrote:
> On Sep 10, 2010, at 1:48 PM, Ryan Culpepper wrote:
>> The way the rackunit tool does it (to make the rackunit gui DrRacket-aware) is to attach a module into the user namespace on every execution by overriding the 'reset-console' method of drracket:rep:text%. See rackunit/tool.rkt for the code.
>> Then you can have a module/teachpack that just requires the attached module.
> Good Gravy!  It would have taken me *weeks* to figure that out. Especially the bit about making the shared link module written in the #%kernel language. Yikes!

I think it did take weeks, plus a few conversations with Robby, to get 
that bit of code right. (Although part of that was about threads and 

Using the #%kernel language for the shared moduel is probably overkill, 
since IIUC DrRacket already attaches other modules to make classes and 
guis work.

Robby: What modules currently get attached by DrRacket?

> It works like a charm.
> Many thanks,

Glad to help!


Posted on the dev mailing list.