lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Kurz <n...@verse.com>
Subject Re: [lucy-dev] FieldType Equals() and class membership
Date Thu, 03 Mar 2011 00:40:45 GMT
On Wed, Mar 2, 2011 at 4:07 PM, Marvin Humphrey <marvin@rectangular.com> wrote:
> For some classes, e.g. CharBuf, Equals() should emphatically *not* test for
> class membership, so that e.g. a CharBuf and a ViewCharBuf with the same
> logical content test as equal.  For FieldType, I can't think of a scenario
> where having objects which belong to different classes test as equal would be
> desirable.

All sounds reasonable and like good changes.  My only thought would be
that it might be better not to mentally overload the name Equals.
Maybe FType_SameClass() would be clearer?

At heart, I'm really not in favor of overloading anything, so I'd even
be happy to rename both of them if it would improve clarity.  Should a
CharBuf and a ViewCharBuf  have the SameContent()?

While I'm nitpicking, is the '!!' really necessary there?  I'm not
sure how these fields are being used, but is it certain that one
always wants to consider things the same if these have different
values?

--nate

Mime
View raw message