Not sure if this was answered already, but I think it would still short-circuit in broadcasting. Just not the way that people wrote above.
In this example, I don’t think you’d see anything printed, although I can’t test as I’m still on an older Julia version.
function f(x)
println("f was called")
isodd(x)
end
x = [false, false, false]
y = [1, 2, 3]
z = x .&& f.(y)
I think this should be the same as this, so it shouldn’t execute f
:
broadcast(x, y) do _x, _y
_x && f_(y)
end
The examples above tried to short-circuit before the array arguments were even created, which doesn’t work.