You could also have a third file, test-a-and-b.rkt, that requires both
a.rkt and b.rkt and includes the test that depend on both files.


On Mon, May 28, 2018 at 10:08 AM Claes Wallin (韋嘉誠) <[email protected]>
wrote:

> (require) binds at compile time and creates a cycle, but by using
> (dynamic-require) you can get past compilation and only load the file at
> runtime, where the seemingly circular reference really isn't.
>
> --
>    /c
>
> On Sun, May 27, 2018, 23:48 Matthias Felleisen <[email protected]>
> wrote:
>
>>
>> Modules cannot refer to each other in a cyclic fashion, including
>> submodules. — Matthias
>>
>>
>>
>> On May 27, 2018, at 8:33 AM, Brandon Irizarry <[email protected]>
>> wrote:
>>
>> Say I have two files, "file-a.rkt" and "file-b.rkt" that each contain a
>> submodule test, like so:
>>
>>
>> Contents of "file-a.rkt":
>>
>> #lang racket/base
>> (define (my-function) 'apple)
>> (module+ test
>>     (require "file-b.rkt")
>>     (other-function))
>>
>> Contents of "file-b.rkt":
>>
>> #lang racket/base
>> (define (other-function) 'orange)
>> (module+ test
>>     (require "file-a.rkt")
>>     (my-function))
>>
>> The require statements form a circular reference, even though running
>> file-b, along with its tests, shouldn't trigger file-a's tests.
>>
>> I've looked into compiling file-a and file-b, but that didn't work.
>>
>> - Brandon
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to