> |What comparison (equality) the array operation '-' based on? I tried to > |define ==, ===, even <=>, but none of them gets called. OTOH, if I have > |two distinct string objects which happen to contain the same characters, > |they are considered equal, even if the ids are not equal. > > Close. It uses "eql?" internally, since comparison is done using > Hash. What does hash comparison mean? I have read the Object#hash and Object#eql? documentation, but they do not mention arrays. Moreover, there comes the question: what the default Object#hash do? It has a generic algorithm which computes something based on the object's attributes? Anyway, I have to define both == and eql? in my classes to work properly? What is the semantical difference of this two method? And then I have to redefine hash also to ensure that a.eql?(b) implies a.hash==b.hash? I try to aim better next time, Ferenc