# Creating structures while writing code

**URL:** <https://discourse.julialang.org/t/creating-structures-while-writing-code/40895>\
**Category:** New to Julia\
**Created:** [June 6, 2020, 10:19pm UTC](https://discourse.julialang.org/t/creating-structures-while-writing-code/40895 "2020-06-06T22:19:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![virtualgraham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/virtualgraham/32/15200_2.png) [@virtualgraham](https://discourse.julialang.org/u/virtualgraham)\
**Post date:** [June 6, 2020, 10:25pm UTC](https://discourse.julialang.org/t/creating-structures-while-writing-code/40895/3 "2020-06-06T22:25:44Z")

</div>

Here is a good answer from another thread. Basically you can put the definition into a module.

> [@Redefine Struct when working with REPL](https://discourse.julialang.org/t/redefine-struct-when-working-with-repl/25942/2):
>
> Personally I’ve found that my structures don’t change too often, mostly it’s the code that is changing, so when I’ve (rarely) needed to change the structures I just do a stop/start of Julia inside atom. If your structures are changing often then you can place them in a module like: module Data struct Lion maneColor::String roar::String weight::Int # Do some work and then realize I need this attribute end end When you rerun the script you will get a warning that…

```julia
module myModule
   mutable struct myTest
       arr::Array{Float64, 1} # arr is an array
       myTest(eqs::Array{Float64,1}) = new(eqs)
   end
end

```

> [@Redefine Struct when working with REPL](https://discourse.julialang.org/t/redefine-struct-when-working-with-repl/25942/2):
>
> When you rerun the script you will get a warning that Data was redefined, which you can ignore. However Data.Lion will now be the new data object.

---

_[View the full topic](https://discourse.julialang.org/t/creating-structures-while-writing-code/40895)._
