`ifelse` query

Compare how your example is parsed with wrapping the return in parentheses.

julia> :(function test(x,y)
          ifelse(x>y,return x, throw(error("err")))
       end)
:(function test(x, y)
      #= REPL[9]:1 =#
      #= REPL[9]:2 =#
      ifelse(x > y, return (x, throw(error("err"))))
  end)

julia> :(function test(x,y)
          ifelse(x>y,(return x), throw(error("err")))
       end)
:(function test(x, y)
      #= REPL[8]:1 =#
      #= REPL[8]:2 =#
      ifelse(x > y, return x, throw(error("err")))
  end)
1 Like