How to define method for (:)?

if I don’t want to do like:

import Base: (:)
(:)(x, y) = xxxxxx

how could I define like:

Base.(:)(x, y) = ...
ERROR: syntax: invalid function name "Base.((:,))"

?
thanks.

Base.:(:)(a, b) = ...

should do the trick

5 Likes