On Sep 18, 2008, at 5:33 PM, Ken Thomases wrote:

Another counterexample is an object which doesn't provide value semantics. That is, its -isEqual: only tests identify (pointer comparison) and whose hash is purely based on the object pointer.

..or say a "person" object which is considered equal if two person objects have the same email address while all other attributes of the object (say phone number, first name, last name, etc.) are not a factor when considering equality. In this case you can safely mutate all properties of said person object except for email address if that object is being used in a collection (or data structure) that depends on hash or isEqual: for its storage and look up.

-Shawn

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to