Infix operator definition syntax needs documentation #15483
Open
Description
I had no idea we support the below syntax for defining infix operators. AFAICT it's not in the manual, and before f07485f I don't think it was in any tests either. Am I the only one who was unaware of this?
julia> import Base.+
julia> immutable wrapper
val
end
julia> a::wrapper + b::wrapper = wrapper(a.val + b.val)
+ (generic function with 172 methods)
julia> wrapper(1) + wrapper(2)
wrapper(3)