Hellow!
how can i get all object field values as tuple better as this:
object_field_values = (getproperty.(repeat([object],fieldcount(T)), fieldnames(T))...,)
Hellow!
how can i get all object field values as tuple better as this:
object_field_values = (getproperty.(repeat([object],fieldcount(T)), fieldnames(T))...,)
Try
ntuple(fieldcount(T)) do i
getfield(x, i)
end
Where x is the instance and T = typeof(x)
I’m on my phone and haven’t tried it, but I think it should do the trick.