Hacker News new | ask | show | jobs
by orangecat 4405 days ago
Or more directly:

  julia> +(a::Int, b::Int) = if a==b==2 5 else a-(-b) end
  julia> 2+2
  5
  julia> 3+1
  4
(The else part can't use + or it will cause infinite recursion).