# Struct with block of missing fields

**URL:** <https://discourse.julialang.org/t/struct-with-block-of-missing-fields/100869>\
**Category:** General Usage\
**Tags:** struct, parametersjl\
**Created:** [June 27, 2023, 2:38am UTC](https://discourse.julialang.org/t/struct-with-block-of-missing-fields/100869 "2023-06-27T02:38:36Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Vasily\_Pisarev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vasily_pisarev/32/7929_2.png) [@Vasily\_Pisarev](https://discourse.julialang.org/u/Vasily_Pisarev)\
**Post date:** [June 27, 2023, 12:31pm UTC](https://discourse.julialang.org/t/struct-with-block-of-missing-fields/100869/5 "2023-06-27T12:31:04Z")

</div>

That wouldn’t work properly as Julia does not dispatch on keyword arguments (see discussion [How can kwargs be used in multiple dispatch - #2 by lmiq](https://discourse.julialang.org/t/how-can-kwargs-be-used-in-multiple-dispatch/86790/2)).

In this particular case, it is not too cumbersome to check all variants of `missing`ness of two kwargs, so I personally would go with that.

On the other hand, I agree that, unless `my_struct` is mutable, a partially-filled case may just be another type. It is even possible to overload `getproperty` so that `.a`-`.e` access would give `missing`, although I’d prefer accessor functions for that.

```julia
function Base.getproperty(x::my_partial_struct, p::Symbol)
    if p in (:a, :b, :c, :d, :e)
        return missing
    else
        return getfield(x, p)
    end
end

```

---

_[View the full topic](https://discourse.julialang.org/t/struct-with-block-of-missing-fields/100869)._
