[plt-scheme] mutually-recursive modules

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Jun 1 14:38:25 EDT 2004

Using an initializer is your best bet then. -- Matthias

On Jun 1, 2004, at 2:26 PM, Doug Orleans wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> Noel Welsh writes:
>> --- Doug Orleans <dougo at place.org> wrote:
>>> So, module B requires module A, but module A needs
>>> to refer to a
>>> procedure P defined in module B.  This trick seems
>>> to work:
>> Seems like a maintenance nightmare.  If P logically
>> belongs in B but is defined in A...I wouldn't want to
>> maintain the code.  Is there a true cycle or is it
>> just B and A depend on P but not vice versa?  If the
>> later, you should put P into a separate module.  If
>> the former I'd use a unit.
> It's a true cycle: P depends on module A.  Moreover, it depends on
> modules C, D, and E, all of which also depend on module A.  If I
> wrapped the definitions in A in a unit, and invoked the unit in module
> B (where P is defined), I think I'd also have to wrap everything in C,
> D, and E in units, so that they could be invoked in B also.  There's
> only one single back-pointer, and this seems like a simpler solution
> than converting everything to units (or putting everything into one
> module).
> --dougo at place.org

Posted on the users mailing list.