Faried Nawaz | 12 Aug 2001 00:58

embarrassing question about the module system.

Hello,

I've written some code and placed it all inside a file with the
appropriate (define-structure ...) wrapper.  Now, the scheme48
manual explains the module system and how to use it from the
command processor, but it doesn't go into using it from scheme
code (or, at least, if it does, I missed it).  How can I perform
the equivalent of ",open mymodule" in scheme?

Thanks,

Faried.

Richard Kelsey | 12 Aug 2001 02:16
Favicon

Re: embarrassing question about the module system.


   From: "Faried Nawaz" <s48 <at> pain.hungry.com>
   Date: 12 Aug 2001 03:58:19 +0500

   How can I perform the equivalent of ",open mymodule" in scheme?

You can do this by loading your program into the ,exec package.
The section "Command programs" in the manual describes how it
works.  Basically, the ,exec package contains the procedures that
are called to execute commands.  For example,

  ,open mymodule

is the same as

  ,exec (open "mymodule")

You can put your command program into a file and then do

  ,exec ,load command-program.scm

to run it.  The file scheme/vm/load-vm.scm in the source
directory is an example of such a program.

                                        -Richard

Jonathan A Rees | 12 Aug 2001 14:43
Favicon

Re: embarrassing question about the module system.

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
   program.

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).
(Continue reading)

Picon

2001 Scheme Workshop: Call for Participation


============================================================================

                           CALL FOR PARTICIPATION

            2nd Workshop on Scheme and Functional Programming

                     Firenze, Italy, 2nd September 2001

Over the past few years, Scheme and its implementations have made
tremendous progress in support of generative programming, shell
scripting, COMponent support and distributed programming, graphics and
GUI support, OO programming, and various other aspects of engineering
real-world software. Following the 1fst Scheme workshop which took
place in Montreal, 17 September 2000, we are calling on implementors
and users of Scheme systems to share their ideas at a 2nd Scheme
workshop during PLI 2001 in Florence. 

               http://kaolin.unice.fr/Scheme2001/

============================================================================

Workshop program
----------------

8h-9h00        Registration PLI 2001 

9h30-9h50      Marc Feeley 
               A Better API for First-Class Continuations 

(Continue reading)


Gmane