If I want to simplify a broadcasted call full of .
s with @.
, what is the recommended way of ensuring that certain values are treated as scalars? Eg should I replace Ref
with $Ref
? MWE:
# setup
a, b = 1, 2
cs = collect(1:10)
f(a, b, c) = a + b + c
# original
cs .= f.(Ref(a), Ref(b), cs)
# @__dot__, is $Ref the simplest way?
@. cs = f($Ref(a), $Ref(b), cs)