What is the best way to iterate through the fields of a composite (user-defined) type in Julia?
Let's say, I defined the following struct and created an instance:
struct Foo
bar
baz::Int
qux::Float64
end
foo = Foo("Hello, world.", 23, 1.5)
How can I iterate through all fields and for example print the fields and their values to the REPL? I have a type with several fields and I don't want to explicitly name every one. Thank you