Sorry to bring this up now, but I think there are three more dots ...
missing there. This beautiful function should read:
julia> function rebroadcast(f,n,args...)
n>1 ? rebroadcast(broadcast,n-1,(f,args...)...) : broadcast(f,args...)
end
rebroadcast (generic function with 1 method)
julia> a = [[1,2,3],[2,3,4]]
2-element Array{Array{Int64,1},1}:
[1, 2, 3]
[2, 3, 4]
julia> b = [[1,1,1],[0,0,0]]
2-element Array{Array{Int64,1},1}:
[1, 1, 1]
[0, 0, 0]
julia> aa = [a, a]
2-element Array{Array{Array{Int64,1},1},1}:
[[1, 2, 3], [2, 3, 4]]
[[1, 2, 3], [2, 3, 4]]
julia> ab = [a, b]
2-element Array{Array{Array{Int64,1},1},1}:
[[1, 2, 3], [2, 3, 4]]
[[1, 1, 1], [0, 0, 0]]
julia> rebroadcast(div,1,[1],[2])
1-element Array{Int64,1}:
0
julia> rebroadcast(div,2,b,a)
2-element Array{Array{Int64,1},1}:
[1, 0, 0]
[0, 0, 0]
julia> rebroadcast(div,3,ab,aa)
2-element Array{Array{Array{Int64,1},1},1}:
[[1, 1, 1], [1, 1, 1]]
[[1, 0, 0], [0, 0, 0]]