Collection of values. Immutable.
struct <name>
<var1>
<var2>
<varN>
#empty constructor
function <struct_name>()
new(1,1,1) #assigns 1, 1, 1 to above
end
# accepts args, and does condition check
function <struct_name>(<varX>,<varY>,...<varZ>)
#do condition check
error("wahtever")
#now create and assign
new(<varX>,<varY>,....<varZ>)
end
end
Default constructor will initialize the variable when creating the object as follows:
p = Prism(2,3,4)
This automatically assigns values inorder to <var1>, <var2> ... <varN>
.
<struct obj>.<varN_name>
CAN make the constructor OUTSIDE of struct:
```julia mutable struct Circle r end
function Circle_const(r::Real) Circle(r) end