How to check if an attribute inside a mutable struct is defined?

Is there any way to check if an attribute inside a mutable struct is defined?

julia> mutable struct Point x ; y ; Point() = new() end

julia> p = Point()
Point(#undef, #undef)

julia> isdefined(p.x)
ERROR: UndefRefError: access to undefined reference

isdefined(p, :x)

5 Likes