Thanks, John.
I am still a little confused:
(1) Does the main module of a package have to be named like the package?
(2) What is the priority of modules/packages when, eg, calling `import
Galaxy` if there is both a package and a module named Galaxy (see example
below)?
(3) What is the correct use of import/using/require?
(4) What is the point of the (documented) syntax
`Pkg.clone("github/fork/url/Galaxy.jl.git", "GalaxyBlue")`? Is it
deprecated? Is it exactly equivalent to a git clone from terminal?
Here is an example which can happen in practice and which is very unclear
to me:
[Package Galaxy]
module Galaxy
(stuff)
module Star
using Galaxy
(stuff)
end
end
[Forked Package GalaxyBlue]
module Galaxy
(stuff)
module Star
using Galaxy <-------------------------------- what
happens here? is it going to use the forked version or load the package
Galaxy?
(stuff)
end
end
(I found a somewhat related discussion here:
https://groups.google.com/forum/#!topic/julia-users/5TAUsNfZmqE
)
Ben
On Tuesday, February 25, 2014 11:28:40 AM UTC-5, John Myles White wrote:
>
> I think the core insight is that a package has two components:
>
> (1) A module called GalaxyBlue
> (2) A file, in a searchable package directory like Pkg.dir(), that’s
> called something like GalaxyBlue/src/GalaxyBlue.jl.
>
> For 2, that means you have a directory (usually a repo) containing the
> package code, a subdirectory called src and then a file called
> PACKAGENAME.jl, which will be automatically loaded. That file should
> contain the definition of your module.
>
> I’m not sure, but I suspect that Pkg.clone with a second argument isn’t
> changing the content of that file.
>
> — John
>
> On Feb 25, 2014, at 7:01 AM, ben <[email protected] <javascript:>>
> wrote:
>
> > Hi,
> >
> > Is it possible for two different packages to contain identically named
> modules?
> >
> > For instance, if I fork a package Galaxy.jl, and then
> >
> > > Pkg.clone("github/fork/url/Galaxy.jl.git", GalaxyBlue)
> >
> > (So that both the original package and my forked version live
> side-by-side in my .julia repository.) How do I then use GalaxyBlue? "using
> GalaxyBlue" and "require("GalaxyBlue")" both give me "ERROR: GalaxyBlue"
> not found.
> >
> > I guess I am generally confused about package names v. module names and
> I was not able to find documentation on this.
> >
> > Thanks!
> >
> > Ben
>
>