I didn’t want to start a new issue in GitHub without checking first what is your opinion on this regard. I found the issue #25098 by change, and I started trying to define a function named “·”. I found various things I try to explain as clear as I can.
I did my checkings in
v"0.6.2", since at the time of checking this, writing a middot would crash the Julia REPL (see issue #25098)
First of all, it is already defined in
Base a function called
julia> (⋅)(x, y) = x * y ERROR: error in method definition: function Base.⋅ must be explicitly imported to be extended
which is normal. Then,
julia> methods(·) ERROR: syntax: invalid character "·" julia> methods(Base.·) ERROR: syntax: invalid character "·"
I think things start to get confusing.
Hence, I checked other behaviours of
methods, but this time I still use by accident the
Base.foo naming to call some functions and I found that
+, as probably other functions defined as operators (unary or binary), throw an error. I listed some of them,
julia> methods(Base.+) ERROR: syntax: unexpected ")" julia> methods(Base.!) ERROR: syntax: missing comma or ) in argument list
A way to avoid this is to write the colon in front of the symbol, which works almost for all cases except the conlon itself
julia> methods(Base.:+) # 182 methods for generic function "+": ··· julia> methods(Base.::) ERROR: UndefVarError: :: not defined
Still I’m not able to add a method to
Any suggestion for the title of this thread is welcome.