Hi,

I'll put this as an example to better explain myself.
In complex.jl there are these two lines:
    ==(z::Complex, x::Real) = isreal(z) && real(z) == x
    ==(x::Real, z::Complex) = isreal(z) && real(z) == x

Is there some "standard" macro to apply to definitions of functions which 
have the same behavior independently of arguments order?
Something like a `@withsymm` macro which can be used as
    @withsymm ==(z::Complex, x::Real) = isreal(z) && real(z) == x
and expands to the two lines above.
Or even maybe to
    ==(z::Complex, x::Real) = isreal(z) && real(z) == x
    ==(x::Real, z::Complex) = ==(z, x)

If not, have you considered (and maybe discarded) the possibility of using 
such macro?

Reply via email to