Suppose I have struct
as below.
struct Foo
attr1
attr2
end
I can then instantiate and get the attr1
and attr2
julia> foo = Foo(1,2)
julia> foo.attr1
1
I'm just wondering if I can do any checking that my object foo
has attr1
?
For reference, python
has hasattr
which exactly what I'm looking for here, but I couldn't seem to find the equivalent in julia
.
Any help would be appreciated.
EDIT: I'm in Julia 1.1.0