You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the clumpsy title, I hope the example makes the idea clearer:
ca =ComponentVector(a=1, b=2, c=3)
ca[[1,2]] # works
ca[[1,2]] .= [-1, -2] # works# Similar, it would be nice to index multiple fields with an array of symbols
ca[[:a, :b]] # doesn't work
ca[[:a, :b]] .= [-11, -22] # doesn't work# This works, but is not quite as elegant:getindex.(Ref(p1), [:a, :b])
setindex!.(Ref(ca), [-11, -22], [:a, :b])