Re: Comparing DS_HASH_TABLE objects

"Franck Arnaud" <[email protected]> Mon, 08 Jun 2009 02:24:54 +0100
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
> But I would use is_deep_equal and deep_twin as a default for is_equal
> and twin. The flat twin is not very meaningful in most of the cases.

is it not? I'm not sure I've ever encountered a legitimate use case for
deep_twin in many years of Eiffel. at work, we have some legacy
deep_clone in the code base. I've been removing some of them as it's an
obsolete routine, and there's very few cases where it is legitimate --
I'm not sure there's even a single case: I think I've seen 2 or 3
sufficiently ambiguous ones so that I've procrastinated fully
understanding what they really do, so that's a "maybe". all the other
cases are either totally redundant (no twin required at all), require a
proper redefined twin with correct implementation for that class, of are
flat objects (only expanded attributes). overall, it's an easy to misuse
and misunderstand feature that should be, if available at all, made
harder to access (e.g. rename it
deep_twin_if_i_use_this_feature_i_ll_create_a_lot_of_bad_karma) to avoid
abuse.

same for deep equality, not useful, though perhaps there's a better
argument for it. in an EQUALITY scenario, is_equal is deferred. it's
only because in ANY that it needs a default implementation. defining a
default equality (deep or flat) in an EQUALITY scenario would be a bit
odd: what do you do with non-EQUALITY attributes?


------------------------------------

To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected]! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/gobo-eiffel/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/