[racket] Order of executing required modules

From: Jos Koot (jos.koot at telefonica.net)
Date: Tue Apr 5 11:17:13 EDT 2011

That's clear. My test modules do not require any other test module and
export nothing.
Lesson learned: modules that are required by other ones should not produce
side effects that may alter the behaviour of another required module. Well,
I never did so, but it is good to be aware of it. I expect that the top
level module of a program may rely on side effects of sub level modules (as
for example in a module defining a new language and read-table for a module
using this language)
Thanks, Jos 

> -----Original Message-----
> From: robby.findler at gmail.com 
> [mailto:robby.findler at gmail.com] On Behalf Of Robby Findler
> Sent: 05 April 2011 16:57
> To: Jos Koot
> Cc: users
> Subject: Re: [racket] Order of executing required modules
> 
> I don't think that there is any particular reason for that specific
> order, but there is a reason not to rely on any order. Specifically,
> if you ever get one of those other files requiring each other, then
> this will disrupt the order you see. For example, if both test-a.rkt
> and test-z.rkt require test-l.rkt, then test-l.rkt will run before
> either of them.
> 
> Robby
> 
> On Tue, Apr 5, 2011 at 9:49 AM, Jos Koot 
> <jos.koot at telefonica.net> wrote:
> > Hi
> > Consider:
> >
> > File all-tetst.rkt
> > #lang scheme
> > (require "test-a.rkt")
> > (require "test-b.rkt")
> > (require "test-c.rkt")
> > (require "test-d.rkt")
> > ...
> > (require "test-z.rkt")
> >
> > It appears that the tests are done in reverse order, id est 
> from z to a in
> > stead from a to z. Not really a problem for me, but it 
> could be for modules
> > that produce side effects (for example, one writing a file, 
> the other one
> > reading it) I wonder: is there a specific reason for the reversed
> > invokations of the required modules? Or should I use 
> another manner for
> > running the tests in a specific order?
> >
> > Thanks, Jos
> >
> > _________________________________________________
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >




Posted on the users mailing list.