From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3a7c1845ec5caf9 X-Google-Attributes: gid103376,public From: geert@gonzo.sun3.iaf.nl (Geert Bosch) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/27 Message-ID: <5jvpom$smj$1@gonzo.sun3.iaf.nl>#1/1 X-Deja-AN: 237757382 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335E0B1F.12C9@elca-matrix.ch> <335F5971.6375@elca-matrix.ch> Organization: La Calandre Infortunee Newsgroups: comp.lang.ada Date: 1997-04-27T00:00:00+00:00 List-Id: Robert A Duff (bobduff@world.std.com) wrote: ``OK, but then if I redefine "<" on a scalar type, should ">=" change? After all, ">=" is (or could be) defined as "not <". '' No, I don't think you can do that. For a program that finds all anagrams of some text, I defined a "Signature" type. A signature of a string is an (long) integer sized hash-value, that makes it possible to efficiently implement the following partial ordering: Given strings A and B with signatures SA and SB: when SA > SB, then A is not a partial anagram of B; ie. A cannot be made with the characters of B. In this case SA > SB does not imply that SB < SA. Of course you might argue that redefining comparison operators to implement a type with partial ordering is a "bad thing". I think it makes the program much more readable. Regards, Geert