I am creating a module (Cows) that calls another module I created in another file (Environment), but everytime I try to use it get this message:
WARNING: replacing module Envs.
WARNING: replacing module Cows.
**ERROR:** LoadError: UndefVarError: Environment not defined
Stacktrace:
[1] top-level scope
@ ~/path/to/file/Cows.jl:9
[2] **include(** fname::String **)**
@ Base.MainInclude ./client.jl:444
[3] top-level scope
@ REPL[1]:1
in expression starting at /path/to/file/Cows.jl:7
My code is:
Cow.jl:
include("Environment.jl")
using .Envs
module Cows
mutable struct Cow
environment::Environment
end
end
Environment.jl:
module Envs
mutable struct Environment
distance_from_pasture::Real
trips_milking_parlor::Integer
topography::String
end
end
I’m using macOS Monterey 12.0.1 with a M1 processor
My Julia version is v"1.6.4"
Could someone help me? I already verified another posts here, on the forum, but I still couldn’t find a solution.