Reputation: 2131
How can I get an array with all the fields of an object? Suppose I have an object obj
with fields a
and b
, I want to get an array with all the fields [:a, :b]
.
Upvotes: 0
Views: 58
Reputation: 2709
You can use fieldnames(obj)
. See http://docs.julialang.org/en/latest/stdlib/base/#Base.fieldnames.
Upvotes: 4