It makes sense now, thanks.
>
>
For what's it's worth, we originally looked relative first and then
absolute, but it was a usability nightmare. This is more explicit and, once
you get it, I think much simpler.
On Wed, Jul 23, 2014 at 9:06 AM, Mauro wrote:
> got it, tnx
>
> On Wed, 2014-07-23 at 16:51, Stefan Karpinski
> wrot
got it, tnx
On Wed, 2014-07-23 at 16:51, Stefan Karpinski wrote:
> Not quite. Note the initial /. When you do `using M` or `import M` it is
> like `cat /M` – it is relative to the root of the module system, not the
> current level of module. When you do `using .M` it is like `cat M` or `cat
> ./M
Not quite. Note the initial /. When you do `using M` or `import M` it is
like `cat /M` – it is relative to the root of the module system, not the
current level of module. When you do `using .M` it is like `cat M` or `cat
./M` – it is relative to the current module. Otherwise when you wrote
`using G
On Wed, 2014-07-23 at 16:29, Stefan Karpinski wrote:
> Main is the root module so /T and ./T are the same thing in Main.
but doesn't the same hold for any other "folder"?
/MyMod/T and /MyMod/./T are the same thing
> On Wed, Jul 23, 2014 at 3:36 AM, Mauro wrote:
>
>> It still needs relative
Main is the root module so /T and ./T are the same thing in Main.
On Wed, Jul 23, 2014 at 3:36 AM, Mauro wrote:
> It still needs relative imports with one dot:
>
> julia> module A
>module B
>foo()=4
>export foo
>end
>using .B
>foo()
>end
>
It still needs relative imports with one dot:
julia> module A
module B
foo()=4
export foo
end
using .B
foo()
end
Which is a bit odd. Because at the REPL, which is in module Main, this
is not needed. This both works:
julia> module T
end
j
Ok I see how that works, I wasn't aware of the ..C syntax. That solves the
problem asked about, but I'm left with another question. Take for example
module A
module B
foo()=4
export foo
end
foo()
end
That doesn't work, I get "ERROR: foo not defined" because foo is not
actually in the A namespac
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 Tue
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, g wrote:
>
> Lets say I'm making a package P.jl. Inside P I define modules A, B and C
> al
10 matches
Mail list logo