# Exporting structs and functions

**URL:** <https://discourse.julialang.org/t/exporting-structs-and-functions/78133>\
**Category:** New to Julia\
**Created:** [March 19, 2022, 3:51pm UTC](https://discourse.julialang.org/t/exporting-structs-and-functions/78133 "2022-03-19T15:51:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [March 19, 2022, 4:46pm UTC](https://discourse.julialang.org/t/exporting-structs-and-functions/78133/2 "2022-03-19T16:46:41Z")

</div>

The short answer is that you need to `include` each file _exactly once_. Including a file multiple times (once via `ammend_props.jl` and again via `main.jl`) creates completely different types and functions that happen to have the same names, which is never what you want. I posted a few relevant answers back on this older thread that might be helpful: [Modules and namespaces - #5 by rdeits](https://discourse.julialang.org/t/modules-and-namespaces/45027/5)

In your case, you could delete `include("agent_type.jl")` from `Ammend_Props` and instead just do `using ..AgentType: Causality` (note the `..` instead of `.` since you’d be referring to the `AgentType` module in the _parent_ `Main`.

---

_[View the full topic](https://discourse.julialang.org/t/exporting-structs-and-functions/78133)._
