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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: Mats Weber Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/25 Message-ID: <3360ABA6.7D55@elca-matrix.ch>#1/1 X-Deja-AN: 237300156 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335E0B1F.12C9@elca-matrix.ch> <335F5971.6375@elca-matrix.ch> <33671d9c.5046069@news.airmail.net> Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-04-25T00:00:00+00:00 List-Id: > >OK, but then if I redefine "<" on a scalar type, should ">=" change? > >After all, ">=" is (or could be) defined as "not <". > > Only for totally-ordered sets. It is useful to redefine "<" and ">" to model > partial orderings, in which case >= is not equivalent a < b. If it's done right, the definition of "=" and "<" is enough to construct the others, even for non-totally ordered sets. Just don't make the mistake of making "<" defined as not ">=": a <= b means a < b or a = b a > b means b < a a >= b meanss a > b or a = b The case where this does not work is when "<=" is not an ordering relation (in the mathematical sense). Non-total orders such as set inclusion work perfectly. And yes, I think that there should be an automatic redefinition in Ada once "=" and one of "<", ">", ">=", "<=" are defined (but I realize it's too late now, this should have been done in Ada 83).