On 2023-01-11, at 10:14 AM, karl ramberg karlramberg@gmail.com wrote:
Tangential to comparison is also the morphic copy methods. What do we mean when we copy a complex object?
..and...
On Wed, Jan 11, 2023 at 5:40 PM Eliot Miranda eliot.miranda@gmail.com wrote:
Equality is tricky. A given definition must be useful “in a general context” (hand waving I know), and must match #hash, and must be reasonably efficient to be usable. All that implies that in non-trivial implements a good comment should be written :-)
These are important points that also impact old favourites like hashing. For copying we have delights such as deepCopy, veryDeepCopy, veryVeryDeepCopy and so forth. For comparison we have convoluted tests that confuse almost everyone in later days.
My suggestion for a flexible, self-documenting, and hopefully intelligible way of handling these cases is to be more explicit. Don't implement #= if what you actually mean is #isEquivalentInCaseOfEditingMorphStructureTo: . Provide #copyMyComplicatedThingForSavingToSIXXStream instead of misappropriating #copy.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Useful random insult:- An 8086 in a StrongARM environment.