[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: isEqual: and hash in NSDate
From: |
Markus Hitter |
Subject: |
Re: isEqual: and hash in NSDate |
Date: |
Fri, 22 Jul 2005 19:03:38 +0200 |
Am 22.07.2005 um 17:26 schrieb Richard Frith-Macdonald:
I therefore propose to follow MacOS-X, leaving the implementation
of -hash as it is, and changing -isEqual: and -isEqualToDate: to
perform exact comparisons. That allows us to use dates as
dictionary keys and gives us MacOS-X compatibility.
This sounds reasonable.
Regarding to this, in my little recherche yesterday, I couldn't find
any difference between -isEqual:, -isEqualTo: and -isEqualToDate:.
The last type is supported by some common other classes as well, e.g.
-isEqualToString:, -isEqualToNumber:, ...
My impression was, -isEqual: is meant for coarse comparisons or hash
comparisons. But that's an impression only.
Since it's interesting for coding in GNUstep/Cocoa as well: Does
anybody know what's the difference between the members of these
trios? Why does -isEqualTo: exist at all and why doesn't NSDate
simply override -isEqual: instead of introducing -isEqualToDate:?
Is it just an historical artefact? Should I file a bug report at
Apple to get rid of at least -isEqualTo:?
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
Re: isEqual: and hash in NSDate, Jeremy Bettis, 2005/07/22