Method for == without import?

question

#1

so i tried

Base.==(...) = ...
Base.(==)(...) = ....
function Base.==(...) ...
function Base.(==)(...) ...

to no avail. if i import Base.==, then all of the above works without Base. not a big deal, but would be nice without. btw this also works, but would not want to use it either

e = :(==)
@eval Base.$e(...) = ...

good luck googling == :slight_smile:. github didn’t give any hits either


#2
julia> immutable Foo end

julia> Base.:(==)(::Foo, ::Foo) = error("bar")

julia> Foo() == Foo()
ERROR: bar
Stacktrace:
 [1] ==(::Foo, ::Foo) at ./REPL[23]:1