Can't we create a macro named "?"

One way is:

julia> macro var"?"(ex)
         @show ex
         nothing
       end
@? (macro with 1 method)

julia> @? c1 ? 1 : c2 ? 2 : 3
ex = :(if c1
      1
  else
      if c2
          2
      else
          3
      end
  end)
2 Likes