[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

module questions




I've been working with the new PLT scheme module system extensively for
about the last week, and in general it's been pretty pleasant.  I have one
simple question and a couple other issues I'd like to discuss.

The simple question is: is there a simple way to provide all the bindings
from a module?  Or is that simply the default when you don't supply a
provide statement?  Typically my modules export most or all of the
functions they define, so explicitly specifying each function in a provide
statement is tedious.

The more complicated issue relates to mutually-recursive modules, which are
not allowed in PLT scheme.  I got slightly burned on this and had to
partition some code in ways other than what I wanted to avoid the mutual
recursion (ocaml has the same issue).  Now, on the one hand I realize that
if you have a lot of mutual recursion between modules, it suggests a level
of interdependency that means that you really should only have one module
(in my case, though, it was just a single function that caused the
problem).  On the other hand, sometimes groups of functions that are
mutually recursive solve conceptually different kinds of problems and it's
desirable to have them divided up into separate files just to keep them
straight in your mind.  I guess what would be ideal given this is something
like the java package mechanism, where the notions of module (package) and
file are kept separate.

So: is there any deep reason for wanting to maintain this
one-module-one-file organization, or is it just out of convenience?

Mike