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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3a7c1845ec5caf9,start X-Google-Attributes: gid103376,public From: "Manuel Wenger" Subject: Equality operator overloading in ADA 83 Date: 1997/04/21 Message-ID: <01bc4e9b$ac0e7fa0$72041dc2@lightning>#1/1 X-Deja-AN: 236496922 Organization: Unisource Business Networks Newsgroups: comp.lang.ada Date: 1997-04-21T00:00:00+00:00 List-Id: Hi, I've started doing some DecADA 83 programming at a technical engineering school ... and I've run into a problem that I was unable to solve (and my teacher didn't know any better either :-)) I've tried to overload the "=" operator for fractions in a package. It obviously doesn't work if the type isn't defined as "limited private", and I don't want that. As an alternative, I found out that I might as well do a renaming declaration, just by defining the type as "private" - so I've tried doing that as well, and then using the following to rename the equal sign: function equal (n,m:fraction) return boolean; function "=" (n,n:fraction) return boolean renames equal; And what do I get? (I love VMS :-)) %ADAC-E-NOTEQOP, (1) Equal is not an equality operator [LRM 6.7(5)] Now - we've tried to look at manuals and everything, but we don't seem able to figure how to define an operator to be an "equality operator". We've just found some weird definitions like "A renaming declaration whose designator is the equality operator is only allowed to rename another equality operator. (For example, such a renaming declaration can be used when equality is visible by selection but not directly visible.)" (DEC Bookreader, ADA reference). In other words, how do I tell my "equal" function to be an equality operator, authorized to be renamed into "="? HELP! :) Please reply via e-mail Thanks in advance -Manuel (to reply, please remove the asterisk at the end of my address)