I know that I need to explicitly import operators from Base if I want to extend them but it is confusing that if I fail to do so, it can either give a helpful error or silently make a new operator depending on whether I've previously used that particular operator.
julia> "a"*2
no method *(ASCIIString,Int64)
julia> *(a::String, b::Int) = "$a$b"
error in method definition: function Base.* must be explicitly imported to be extended
julia> +(a::String, b::Int) = "$a$b"
julia> +
Methods for generic function +
+(String,Int64) at none:1
I know that I need to explicitly import operators from Base if I want to extend them but it is confusing that if I fail to do so, it can either give a helpful error or silently make a new operator depending on whether I've previously used that particular operator.