Loading modules at the REPL in 0.7 - is it different?

My code is divided into several files, say A.jl, B.jl, C.jl, each of which defines a single module, say A, B, C. Inside C.jl there are declarations like this:

import A.myfunction1
import B.myfunction2

In 0.6.2, I was able in the REPL to issue instructions in this order:


and then my code would run. In 0.7-DEV, module C can’t find b.myfunction2. it appears that C.jl now must qualify the import statements with Main:

import Main.A.myfunction1
import Main.B.myfunction2

in order to support this workflow. Is this correct? Why the change? I would rather not explicitly refer to Main in the source files since I might reorganize my code later to look for the modules elsewhere, e.g., using the Package mechanism.

While we’re waiting for enlightenment, I’ll suggest changing to

import ..A:myfunction1
import ..B:myfunction2

This way things continue to work if you wrap up the include statements in another module. (Also seems to work on v0.6).

1 Like

Was this actually solved? When I try to load modules that are written to depend on one another e.g.

B.jl has using A in it

When I try to include A and then B at the REPL, A is loaded as “Main.A” and B is unable to find A.

How should I be writing modules so that they can work independently of whether they are in the REPL or loaded via Pkg? Or should Julia be able to do this already?