Is * a ternary/quarternary operator in 1.7+, or am I missing something that was there before?

I believe the only other such operators are + and ++. And that the parsing has worked this way forever, certainly on 1.0:

julia> :(1*2*3) |> dump
Expr
  head: Symbol call
  args: Array{Any}((4,))
    1: Symbol *
    2: Int64 1
    3: Int64 2
    4: Int64 3

julia> :(1+2+3)
:(1 + 2 + 3)

julia> :(1++2++3)
:(1 ++ 2 ++ 3)

julia> :(1/2/3)
:((1 / 2) / 3)

julia> VERSION
v"1.0.5"

For + and *, there are fallback definitions which work left-to-right, e.g. @less 1 * 2 * 3. What is new on 1.7 is that some chains of matrix multiplication will be done in other orders if this is more efficient. (Before this, there were also some other specialisations such as @which [1,2]' * Diagonal([3,4]) * [5,6].)

1 Like