(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 <matth...@felleisen.org>
wrote:

>
> Modules cannot refer to each other in a cyclic fashion, including
> submodules. — Matthias
>
>
>
> On May 27, 2018, at 8:33 AM, Brandon Irizarry <brandon.iriza...@gmail.com>
> 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 racket-users+unsubscr...@googlegroups.com.
> 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 racket-users+unsubscr...@googlegroups.com.
> 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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to