ludo@gnu.org (Ludovic Courtès) skribis: > In the last case (one, three, two), the compiler: > > 1. compiles ‘one.scm’, which creates module (one) in the global name > space with just ‘expansion-time’ in its exported bindings; > > 2. when compiling ‘three.scm’, it loads ‘two.scm’; since (two) uses > (one), it does ‘(resolve-module '(one))’, and since (one) already > exists it is used; > > however, the (one) we have comes from step 1, and lacks the > ‘run-time’ binding, hence the unbound variable failure. > > I think the right thing would be to use a separate module hierarchy in > the dynamic extent of ‘compile-file’, somehow, such that all module side > effects are isolated. In Guix (the ‘guix pull’ command, which compiles all of Guix), I ended up with this: