On Jan 6, 2006, at 1:14 PM, James Harkins wrote:
In theory you should also check for class equivalence, just in case someone adds a subclass of Color. But that's probably overly picky :) + Color { == {|that| ^(this.class == that.class) and: { (that.respondsTo(#[\red, \green, \blue, \alpha]) and: {(this.red == that.red) and: {this.green == that.green} and: {this.blue == that.blue} and: {this.alpha == that.alpha} } }) } }
no you shouldn't. If someone adds a subclass then with this they can't successfully override == to call super.