Infix operator

This is viewed as a comparison, not a function call: https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm#L16 . And chained comparisons are like &&, they stop early:

julia> Meta.@lower 1 < 2 < 3
:($(Expr(:thunk, CodeInfo(
    @ none within `top-level scope`
1 ─ %1 = 1 < 2
└──      goto #3 if not %1
2 ─ %3 = 2 < 3
└──      return %3
3 ─      return false
))))

Most ordinary infix operators are parsed pairwise, the exceptions are +,*,++:

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

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

julia> :(1 / 2 / 3) |> dump
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

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) |> dump
Expr
  head: Symbol ||
  args: Array{Any}((2,))
    1: Int64 1
    2: Expr
      head: Symbol ||
      args: Array{Any}((2,))
        1: Int64 2
        2: Int64 3
3 Likes