From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.7 required=3.0 tests=BAYES_00,NICE_REPLY_A, REPLYTO_WITHOUT_TO_CC,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: overloading predefined operators Date: Sat, 25 Jun 2022 08:21:33 +0200 Organization: A noiseless patient Spider Message-ID: References: <1fabca7a-e3f0-41bb-9b51-9eabde85e800n@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 25 Jun 2022 06:21:33 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="f993db08ecda2d93a44b0b761c64ae5e"; logging-data="3536"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18THbr9hsDlIPo7W+ylPAHkvFbZU4K1Utw=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Cancel-Lock: sha1:yudMaba5t0ivJqaZXcBlz3QWtbk= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:64032 List-Id: On 25.06.22 07:58, L. B. wrote: > Randy, > >> I generally prefer to use prefix notation in such cases rather than renaming >> (which is easy to get subtly wrong). Remember that you can call any Ada >> operator as if it is a normal function. So: >> >> if Standard."=" (A, B) then > > I tried this in > https://github.com/Blunk-electronic/ada_training/blob/master/src/redefining/equality_1/equality.adb > see line 99. > > The compiler says: > equality.adb:99:20: incompatible arguments for operator That's the compiler telling you that TYPE_FLOAT is not type Float, the type of arguments needed for Standard."=" (see above). See Jeffrey Carter's response for what to do to make them that.