Hello!
I have made a small package here:
In this package I have a folder structure such as:
- src
- geometry.jl
- main.jl
- main_package.jl
- math_vectors.jl
In which I try to split stuff into modules, because this is what I like from Rust.
Basically math_vectors define some basic math functionality I want, geometry uses this functionality, main_package bundles the two together and they are then called in main:
include("main_package.jl")
using .main_package
a = Vec(1.,2.,3.)
b = Vec(2.,4.,6.)
println(a + b)
println(a - b)
println(a / b)
println(a * b)
println(ℕ²(a))
println(â„•(a))
v1 = Vec(0.,0.,0.)
v2 = Vec(1.,1.,1.)
vline = draw_line(v1,v2,0.4)
println(vline)
When I do like this it works fine to call “Vec”, but when I try to use “draw_line” from geometry.jl:
ERROR: MethodError: no method matching draw_line(::Vec{Float64, Float64, Float64}, ::Vec{Float64, Float64, Float64}, ::Float64)
Closest candidates are:
draw_line(::Main.geometry.math_vectors.Vec, ::Main.geometry.math_vectors.Vec, ::Number) at ~/.julia/dev/SPH_jl/src/geometry.jl:7
Stacktrace:
[1] top-level scope
@ ~/.julia/dev/SPH_jl/src/main.jl:18
Suddenly it does not accept “Vec” from “main space”, but wants a specific version. How do I fix this?
Kind regards