Does the following examples help?

julia> NearestNeighbors.KDTree
ERROR: UndefVarError: NearestNeighbors not defined
 in eval(::Module, ::Any) at ./boot.jl:243

julia> import NearestNeighbors

julia> NearestNeighbors.KDTree # Can use dot notation on the imported module
NearestNeighbors.KDTree{T<:AbstractFloat,M<:Union{Distances.Chebyshev,
Distances.Cityblock,Distances.Euclidean,Distances.Minkowski{T<:Real}}}

julia> KDTree # Without dot, type is not found
ERROR: UndefVarError: KDTree not defined
 in eval(::Module, ::Any) at ./boot.jl:243

julia> import NearestNeighbors.KDTree # Importing the type

julia> KDTree # Now we don't need to qualify the module because it is in 
scope
NearestNeighbors.KDTree{T<:AbstractFloat,M<:Union{Distances.Chebyshev,Distances.Cityblock,Distances.Euclidean,Distances.Minkowski{T<:Real}}}



On Wednesday, April 20, 2016 at 4:12:31 PM UTC+2, Didier Verna wrote:
>
>
>   There are a couple of things that I find obscure in the modules 
>   documentation. 
>
> It says that import operates on a single name at a time, but there's a 
> counter-example in the table right below this sentence: import MyModule 
> which looks like it imports a module as a whole. 
>
> On the other hand, the table in question says that with such a 
> directive, MyModule.x (and y and p) are "brought into scope" and 
> "available for method extension". But from what I could gather, it seems 
> to me that the dot notation always makes everything available. So it 
> would rather seem that import MyModule is a no-op. Is that correct? 
>
> -- 
> ELS'16 registration open! http://www.european-lisp-symposium.org 
>
> Lisp, Jazz, Aïkido: http://www.didierverna.info 
>

Reply via email to