It is at least somewhat inconsistent, since
julia> a.*a
3-element Array{Number,1}:
 1.0
 4.0
 9.0
The definition of .^ is given in array.jl line 703 as
.^(x::StridedArray, y::Number      ) =
    reshape([ x[i] ^ y for i=1:length(x) ], size(x))

I am not sure why it is not done in the same way as .* a few lines below 
that?

However, one thing that surprised me is the following
julia> foo(a) = reshape([ a[i] for i=1:length(a) ], size(a))
foo (generic function with 1 method)

julia> a
2-element Array{Number,1}:
 1
 2

julia> foo(a)
2-element Array{Number,1}:
 1
 2

julia> reshape([ a[i] for i=1:length(a) ], size(a))
2-element Array{Any,1}:
 1
 2

Is it obvious why one gets Array{Number} and Array{Any} in the two cases 
(it probably is obvious, but I can't figure it out right now)?

Reply via email to