i'm having some trouble loading module in Julia. I have to module that i cant load in my main file.
So my code (i'm trying to make an octree) look like this:
module Node
export node, contains, intersect
mutable struct node
x::Float64
y::Float64
z::Float64
m::Float64
node(x,y,z) = new(x,y,z,0)
end
end # module
and my other module:
module Tree
include("Node.jl")
using .Node
export tree, insert!, subdivide!
mutable struct tree
capacity::Int64
node::node
divided::Bool
tree(capacity, node) = new(capacity, node, false)
end
end
My problem is when i try to import the module in my main file using something like that:
include("Node.jl")
using .Node
include("Tree.jl")
using .Tree
plop=node(0,0,0)
plip=tree(1,plop)
I get the following error:
ERROR: LoadError: MethodError: Cannot `convert` an object of type node to an object of type Main.Tree.Node.node
I understand its due to the using .Node
in my tree module which conflict with the same import in the main file but i'm unable to find a workaround.
One solution would probably be to put everything in the same module but i would like to keep thing separated.