Ever wanted to define a class, maybe a vector class, and make it possible to write code like
dim v1 as new Vector(1,1)
dim v2 as new Vector(2,2)
if v1 v2 then
// do something when v1 v2
elseif v1 < v2 then
// do something when v1 < v2
else
// do something when v1 = v2
end if
Perhaps you have some other kind of class you’d like to define that has some kind of custom mechanism to compare itself to other instances – or even other data types.… Read the rest