Closed ericvsmith closed 7 years ago
Hm, but excluding a field from the hash that's included in eq still could be useful, e.g. if the field's hash would be expensive to compute and there are other fields contributing to the overall hash. (Not the other way around, but you've already got that covered.)
Okay, I'll leave the field-level hash and cmp flags.
Although, if you can leave it out of the hash, why can't you also leave it out of the comparison functions?
I'm just trying to make the interface simpler, but if both flags need to stay, so be it.
There's a legitimate reason for having a field in the eq but not in the hash. After all hash is always followed by an eq check and it is totally legit for the eq check to say two objects are not equal even though their hashes are equal.
Okay. I'll leave it it (this time for keeps!).
Since we're saying it should always match what's currently the "cmp" flag, let's just force it to be the same by getting rid of the "hash" flag. This will slightly simplify the
field()
call.