Without the Ref() it appears that only a single element is removed from each element of a (and an error is raised if ind and a have different lengths). Why is the behavior different?
If f is a function, a a vector, and b a scalar, then the dot syntax
f.(a, b)
means
[f(a[i], b) for i in 1:length(a)]
If ‘b’ is instead a vector of length 1 it means
[f(a[i], b[1]) for i in 1:length(a)]
If b is a vector of length more than one it is indexed together with ‘a’
[f(a[i], b[i]) for i in 1:length(a)]
assuming that a and b have the same length, otherwise it’s an error.
For our deleteat! application we don’t want to index into ‘b’, which we can avoid by placing it in a container of size 1, e.g. [b] (single element vector) or (b,) (single element tuple)
f.(a, (b,))
which means
[f(a[i], (b,)[1]) for i in 1:length(a)]
or equivalently
[f(a[i], b) for i in 1:length(a)]
The use of Ref(b) is equivalent to (b,) in this context.