From: Zach Dennis Date: 2003-10-02T03:46:02+09:00 Subject: Re: Making == symmetric? I don't even know if I've been using Ruby long enough( the past few days ) to even comment, so I'll keep my opinions brief. In regards to what Mark Wilson said about Sean O'Dells comments: >I don't know enough to have firm views on the topic, but I do have a >couple of thoughts. > >1. Sometimes, one will want two objects of the same class and with the >same attributes to return false when the == operator is applied. For >example, a pool of identical server objects should not be considered >equal to each other. > >2. In general, two objects of different classes should return false >when the == operator is applied to either of them, unless the classes >differ only in name. I think whether this behavior is varied in >specific cases would depend on how the class is meant to be used. on #1. I agree with Mark and I'd also like to say...why would you want to use the == to return true when comparing different objects, even if they are of the same class, with the same attributes. Unless one's a pointer or reference and you are using an equivalency of a === test. I don't see why someone would want this expected behavior from == itself. on #2. I think 2 different classes should always return false when compared to one another. Otherwise you are getting away from the simplicity and purpose of a comparison in it's most generic form and you are bringing in special cases where "behavior is varied". If you want to allow for special case scenario's then perhaps make a new comparison operator/method and leave == alone. I way even be off with my whole post, if I am just tell me to hush up. =) -Zach