Checking if a string is null

Bruno Medeiros brunodomedeiros+spam at com.gmail
Sun Jul 29 04:38:15 PDT 2007


Manfred Nowak wrote:
> Bruno Medeiros wrote
> 
>> What do you mean by "I believe that types exist for which such a 
>> relation is not uniquely determined" ?
> 
> "most discriminating" implies an ordering on the set of equivalence 
> relations. For some types this ordering might be a partial ordering.
> 
> If such types with partial orderings on their equivalence relations 
> exist, then 
> 1 there might be no canonical minimal element, or
> 2 there is a canonical minimal element, but it is not "possible", which
> : makes this case equivalent to the one above.
> 
> If there is no minimal element then there exist (with respect to 
> discrimination) at least two uncomparable equivalence relations.
> 
> -manfred  
> 

Seriously, please don't take this as a personal attack, but you have a 
great skill at creating gibberish-sounding mathematical complications 
where none exist, or where none are necessary.

"most discriminating" implies that there is a *partial* (not total, 
regardless of the types) ordering on the set of equivalence relations 
(these relations being the possible valid equals implementations). But 
it _also implies_ there is one element which is less (or more) than all 
the others, so there is a "minimal element".


BTW:
That order is based on "discrimination", which is how often the 
function/relation has a false value, in all possible inputs. The less 
discriminating relation is one whose value is allways true (ie., all 
objects compare equal).
The most discriminating relation (which is the default Object.equals 
implementation) is where two objects only compare equals if they are the 
*same*, ie. they have the same identity (if somehow you don't fully 
understand the concept of identity, which should be clear enough, I'm 
sure Java has it well defined somewhere).
(Also: the most discriminating relation is not to return false for all 
objects, because the relation must still respect the equals contract).

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list