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/29 Message-ID: <3365BDC7.470A@elca-matrix.ch>#1/1 X-Deja-AN: 238139155 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335E0B1F.12C9@elca-matrix.ch> <335F5971.6375@elca-matrix.ch> <33671d9c.5046069@news.airmail.net> <3360ABA6.7D55@elca-matrix.ch> Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-04-29T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Mats says > > < once "=" and one of "<", ">", ">=", "<=" are defined (but I realize it's > too late now, this should have been done in Ada 83).>> > > This would be a terrible idea, since it would build in serious inefficiencies. > A typical way of implementing comparisons for a complex type is to have a > single comparison routine that indicates the compare status (LT, EQ, GT) and > then have the operators be a simple wrapper around this routine. > > [...] When efficiency is important, the programmer can define all five relational operators explicitly (and inline them, etc.). When he is lazy, he can define just two. I don't really see the problem.