To make a phased comparison, Julia requires that both arrays have the same number of elements. This can be achieved in this case with the understanding:
julia> x = Any[[1,2],[2,3],[3,4],[4,5]] 4-element Array{Any,1}: [1,2] [2,3] [3,4] [4,5] julia> x[x.==[[3,4] for i in 1:length(x)]] 1-element Array{Any,1}: [3,4]
So, the question in my mind was βwhy didn't Julia pass [3,4] into this form automatically?β The following example translates correctly:
julia> y = [1,2,3,4] 4-element Array{Int64,1}: 1 2 3 4 julia> y.==3 4-element BitArray{1}: false false true false julia> y[y.==3] 1-element Array{Int64,1}: 3
It seems that Juliaβs broadcasting mechanism cannot conclude that we want [3,4] broadcast in [[3,4],[3,4],[3,4],[3,4]] , not any other kind of array.