# Initialising a Constructor with an Undef value

**URL:** <https://discourse.julialang.org/t/initialising-a-constructor-with-an-undef-value/77438>\
**Category:** General Usage\
**Created:** [March 5, 2022, 7:14am UTC](https://discourse.julialang.org/t/initialising-a-constructor-with-an-undef-value/77438 "2022-03-05T07:14:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imantha](https://avatars.discourse-cdn.com/v4/letter/i/6a8cbe/32.png) [@imantha](https://discourse.julialang.org/u/imantha)\
**Post date:** [March 5, 2022, 7:14am UTC](https://discourse.julialang.org/t/initialising-a-constructor-with-an-undef-value/77438/1 "2022-03-05T07:14:33Z")

</div>

Hi, I have two Struts where one struct requires and object of the other as one of it’s fields. I am wondering how to initialise with an undef value of it. Here is an example

```julia
mutable struct Casualty
  id::Int
  pos::Tuple{Int,Int,Float64}
  trauma::Int
  awaiting_rescue::Bool
end

mutable struct Rescuer
  id::Int
  pos::Tupe{Int,Int,Float64}
  casualty_in_rescue::Casualty
  casualties_rescued::Vector{Casualty}
end

rescuer_x = Rescuer(1, (75,75,160.1), undef, Casualty[])

```

I am wondering what to add instead of undef (which is ofcourse incorrect), where it will represent something similar to NaN value (which cannot be added cause its Float type)

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [March 5, 2022, 8:06am UTC](https://discourse.julialang.org/t/initialising-a-constructor-with-an-undef-value/77438/2 "2022-03-05T08:06:13Z")

</div>

how about this as your default nonevent

```julia
const NoCasualty = Casualty(0,(0,0,0.0),0,false)

```
