Are you not seeing this: julia> using MyModule.x, MyModule.p julia> x() "x"
julia> p() "p" julia> y() ERROR: y not defined This is consistent with the description in the documentation. However, if it wasn't clear that this is what was meant by being "in scope," then the documentation could be further improved. Some of your other points also seem like valid concerns. I suspect the resolution is: in all those cases, MyModule itself is in scope, and you can always use MyModule.something to access something, even if "raw" something is not in scope. To clarify these points, you can edit the documentation on the website: https://github.com/JuliaLang/julia/blob/master/doc/manual/modules.rst by clicking on the pencil icon. When you're happy with your changes, submit them and they will be reviewed for potential inclusion in the manual. --Tim On Saturday, September 27, 2014 12:52:22 PM Marc Gallant wrote: > Hi, I'm using Julia 0.3.1 and I feel like I'm seeing behaviour that is > different from what is indicated in the manual in the "Modules" section > (specifically, in the table) here: > > http://docs.julialang.org/en/release-0.3/manual/modules/ > > I was playing around to learn the difference between using, import, and > importall, and I noticed that no matter what you do in the "Import Command" > column of the table, MyModule.x, MyModule.y and MyModule.p > are always brought into the scope. So shouldn't every row in the table > mention this (seeing as it's included in 1st and 4th rows)? > > Also, a few paragraphs earlier is the statement: > > "The import keyword supports all the same syntax as using, but only > operates on a single name at a time. It does not add modules to be searched > the way using does. import also differs from using in that functions must > be imported using import to be extended with new methods." > > I found this statement confusing because you can always extend functions > from MyModule using the syntax MyModule.x(a, b) = a + b, for example, even > if MyModule was brought into the scope with a "using" statement. > > Finally, I find it kind of confusing that when importing or using specific > entities from MyModule (e.g., import MyModule: x, y or using MyModule: x, > y), you can still access MyModule.x and MyModule.y in addition to just x or > y. This ties into my first point of MyModule.x, MyModule.y and MyModule.p > always being brought into scope. Just wondering if there is a difference > between using one versus the other. > > Thanks, > Marc
