[racket] Splitting Racket source code by scope?

From: Rüdiger Asche (rac at ruediger-asche.de)
Date: Wed Feb 29 18:38:38 EST 2012

ok, so the difference is between doing things in the upper respective lower 
window - thanks for the instructions; if I follow them with my code 
fragments, it works as well. Trying to do everything interactively (lower 
pane) yields the errors I described (btw it's the same behavior as when I 
run in racket instead of DrRacket). Now that'll give me a starting point to 
look at things - however, eventually the whole thing must run on either 
Racket or some other rudimentary Scheme environment, so the crucial issue 
will be whether everything related to units is "merely" syntactic extensions 
(meaning that at the end of the day, no additional runtime support is 
required) or not - in the latter case, the unit architecture, powerful as it 
may be, may not serve my needs after all. I'll look at this.

In the meantime, thanks again for your patience and ultra fast response!

----- Original Message ----- 
From: "Danny Yoo" <dyoo at cs.wpi.edu>
To: "Rüdiger Asche" <rac at ruediger-asche.de>
Cc: "Racket mailing list" <users at racket-lang.org>
Sent: Thursday, March 01, 2012 12:21 AM
Subject: Re: [racket] Splitting Racket source code by scope?

Hi Rüdiger,

The top of all four files should have

   #lang racket

at the very top.  This declares the file to be a module in the full
Racket language.  Other documentation out there that are a few years
old might refer to the older style of defining modules, where there's
an outer "(module foo mzscheme ...)", which "#lang racket" supercedes.

About your point 2 about having to change the require paths: This is
odd: you shouldn't have to do that.

It may be that your copy-and-paste might have failed in some way.

Here, let me zip up the files for you.  I've put them temporarily at:


To run the example in:


Go and open DrRacket.  In DrRacket, Open the simple-factory-unit.rkt file.

Press Run, which will run the program and allow you to experiment 

Once the program has run, type at the Interactions window at the
bottom half of the window:

    (invoke-unit simple-factory@)

and press Enter.

Let's make sure that this works: if you hit any problems, let us know!

Posted on the users mailing list.