Hi Davide,

Looks like an issue of operator precedence: 
http://docs.julialang.org/en/release-0.4/manual/mathematical-operations/#operator-precedence

That is, since `\` is higher precedence than `:`, your initial line is being 
parsed as `(randn(3, 3)\1):3`, so the error seems to be correct.

Cheers,
Josh

On May 22, 2016 at 17:31:36, Davide Lasagna (lasagnadav...@gmail.com) wrote:

Hi, 

Is this a parsing "error" worth reporting?

julia> randn(3, 3)\1:3
ERROR: MethodError: no method matching /(::Int64, ::Array{Float64,2})
Closest candidates are:
  /(::Integer, ::Integer)
  /(::Real, ::Complex{T<:Real})
  /(::Union{Int16,Int32,Int64,Int8}, ::BigFloat)
  ...
 [inlined code] from ./arraymath.jl:347
 in \(::Array{Float64,2}, ::Int64) at ./operators.jl:270
 in eval(::Module, ::Any) at ./boot.jl:226

# although
julia> randn(3, 3)\(1:3)
3-element Array{Float64,1}:
   542.05
  -506.452
 -1484.16


Reply via email to