What controls if a an operator 1⊕2⊕3 is varadic

Contrast how + parses vs a custom operator:


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

it becomes +(1,2,3)

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

it becomes ⊕(⊕(1,2),3).

* does it also
Is it just + and * that is special?
or is there a unicode category that does this?

Some operators ( + and * ) use N-ary parsing; chained calls are parsed as a single N-argument call.

6 Likes

So it it literally just those two? They are not examples, that is the full list?

2 Likes

++ as well I believe

3 Likes