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: kst@sd.aonix.com (Keith Thompson) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/24 Message-ID: #1/1 X-Deja-AN: 237012000 Sender: news@thomsoft.com (USENET News Admin @flash) X-Nntp-Posting-Host: pulsar References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <33602040.3178674@news.airmail.net> Organization: Aonix, San Diego, CA, USA Newsgroups: comp.lang.ada Originator: kst@pulsar Date: 1997-04-24T00:00:00+00:00 List-Id: In <33602040.3178674@news.airmail.net> clines@delete_this.airmail.net (Kevin Cline) writes: > "Manuel Wenger" wrote: [...] > >In other words, how do I tell my "equal" function to be an equality > >operator, authorized to be renamed into "="? HELP! :) > > You can't. Period. Why? I don't know. Drove me crazy once. > Maybe some Ada-83 committee member will volunteer why it was > considered reasonable to redefine '<' and '>' but not '=' . Actually, you can. Though the designers of Ada 83 intended to prohibit overloading of "=" for non-limited types, it can be done by tricky use of generics. I don't remember the exact details, but the idea is that it's legal to overload "=" for a limited private generic formal type and it's legal to pass a non-limited type as the actual for a limited private formal. Perhaps someone else can provide details and credit the originator. -- Keith Thompson (The_Other_Keith) kst@sd.aonix.com <*> TeleSo^H^H^H^H^H^H Alsy^H^H^H^H Thomson Softw^H^H^H^H^H^H^H^H^H^H^H^H^H Aonix 5040 Shoreham Place, San Diego, CA, USA, 92122-5989 "Humor is such a subjective thing." -- Cartagia