Rats, I should check before posting.

--T

On Tuesday, July 22, 2014 06:09:40 PM Iain Dunning wrote:
> module P
>   module C
>     export foo
>     foo() = 2
>   end
>   module A
>     using ..C
>   end
>   module B
>     using ..C
>   end
> end
> 
> Tested with
> julia> P.A.C.foo()
> 2
> 
> On Tuesday, July 22, 2014 9:04:17 PM UTC-4, ggggg wrote:
> > Lets say I'm making a package P.jl.  Inside P I define modules A, B and C
> > all in separate files. I'd like to use C inside of A and B, and export a
> > function from C from P.
> > 
> > So right now B looks like
> > include("C.jl")
> > module B
> > using C
> > B body
> > end
> > 
> > And A looks like
> > include("C.jl")
> > module A
> > using C
> > A body
> > end
> > 
> > And P looks like
> > include("A.jl")
> > include("B.jl")
> > include("C.jl")
> > module P
> > using A,B,C
> > P body
> > end
> > 
> > I suspect that I'm doing it wrong for a few reasons.
> > 1. I'm using two lines to get a module instead of one (include + using)
> > 2. I've included C three times in P.
> > 3. Autoreload.jl is complaining
> > 
> > At the least it seems like I should remove "include("C.jl")" from P, which
> > seems to help.  I'd appreciate some general guidance.

Reply via email to