Re: embarrassing question about the module system.
Jonathan A Rees <jar <at> s48.org>
2001-08-12 12:43:07 GMT
Not so embarrassing a question.
Here's how I use the module system for a typical program:
1. I write Scheme code and put it in a set of .scm files. These files
don't use any module system constructs.
2. I write a "configuration file" config.scm containing define-structures.
I tend to have one configuration file for each directory.
3. To run the program in a fresh Scheme 48, assuming its main entry
point is procedure "run" in structure "program":
,config ,load config.scm ;as many as necessary
,in program (run)
4. When debugging, I make heavy use of ",in" and emacs's scheme48
mode. Pieces of the configuration file can be reevaluated if
interfaces or opens change, without having to reload the entire
Segregating scheme code from configuration code has a number of nice
properties, including: (1) the emacs interface works much better, (2)
code can be developed in a single environment and later carved up into
modules without touching the source files, (3) the code may have a
chance of running in Scheme implementations other than Scheme 48.
At no point do I write ordinary Scheme code that uses the module
system, unless the program inherently needs meta-level understanding
of the module system (e.g. an alternative processor for module
definitions, or a command processor of some kind).