Help broadcasting with a custom type. I have a custom type and I'm having trouble

Help broadcasting with a custom type.

I have a custom type and I’m having trouble with broadcasting. I can do

r .= [1, 3]

to update the values of r. But I don’t know what kind of broadcasting tool to implement to get

r[1:2] .= [3, 6]

to work. I’ve defined copyto!(r::MyType, bc::Base.Broadcasted) but that doesn’t seem to automatically get me broadcasted setindex.

Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster here on Discourse so they can follow this thread.
(Original message :slack:) (More Info)

1 Like