dwerner
dwerner

Reputation: 6602

Operator overloading in Boo - op_NotEqual?

I have an old C# library that I am converting to Boo, and it uses operator overloading. In the interest of not to getting into the why of that, I am looking for a way do the same thing in Boo.

This takes the form:

public static bool operator <(Duration duration, TimeSpan timespan) {...}

But, Boo uses a different form of operator overloading, and does not have an 'operator' keyword.

public static def op_LessThan(duration as Duration, timespan as TimeSpan) as bool:
    pass

(From http://boo.codehaus.org/Operator+overloading)

These binary operators can be overloaded:

But I don't see anything like op_NotEqual(!=) in that list. Are these methods equivalent to the above C# code? And if so, what would be the equivalent of

public static bool operator !=(Duration duration, TimeSpan timespan) {...}

Upvotes: 1

Views: 207

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564631

It should be op_Inequality (from the C#/.NET side) - but I don't know if or how this is supported in Boo. I suspect it's just a documentation error, and will likely work fine.

Upvotes: 2

Related Questions