C
Chris Parker
Hi,
I want to overload the != operator. I can overload the == operator. I
get this error when I try to run the code without commenting out the !=
operator overloading function:
CSP.rb:72: syntax error
def !=(other)
The actual code is simply:
def !=(other)
end
Does Ruby not allow overloading !=? Does Ruby just give you != from
==? This is a bit of a problem for my case because while != is the
opposite of ==, there is a significant time improvement for stopping as
soon as possible for !=.
Any help would be greatly appreciated.
Chris
I want to overload the != operator. I can overload the == operator. I
get this error when I try to run the code without commenting out the !=
operator overloading function:
CSP.rb:72: syntax error
def !=(other)
The actual code is simply:
def !=(other)
end
Does Ruby not allow overloading !=? Does Ruby just give you != from
==? This is a bit of a problem for my case because while != is the
opposite of ==, there is a significant time improvement for stopping as
soon as possible for !=.
Any help would be greatly appreciated.
Chris