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,d44726544972ff65 X-Google-Attributes: gid103376,public From: "bklungle" Subject: Re: GNAT 3.10p and GCC 2.7.2.3 Date: 1998/02/08 Message-ID: <01bd34be$00c9d5e0$0e2915c0@p5120>#1/1 X-Deja-AN: 323188586 References: <6bguq9$rjh$2@uuneo.neosoft.com> <34DDED2F.7AF4@arlington.net> Organization: B & D Associates X-NETCOM-Date: Sun Feb 08 10:09:58 AM PST 1998 Newsgroups: comp.lang.ada Date: 1998-02-08T10:09:58-08:00 List-Id: Mike, Maybe I misunderstood your reference to standard math function overloads not working in gnat-3.10. The following was hacked quickly on 3.10 on NT. Compiled and executed fine. Note the overload of "+" in Mtest from M. From your comment, it sounds more like the data types of the new defining functions were somehow mapping directly to the System defined ones, perhaps from using a subtype declaration instead of a type. Just a guess on my part. Anyway, as I said, I may have misunderstood your statement. cheers...bob > Let me add to this thought, ... > > Overloading of basic arithmetic operators (+,-,>,<,mod,rem ...) which > worked in GNAT Ada 3.07 and 3.09 doesn't work in 3.10. The compiler > complained that it couldn't resolve ambiguous references for these > operators between our file and 'System' even though the low level math > operations were fully resolved within the boundaries of the file being > compiled. Unfortunately, we have to overload the operators because of > the peculiarities of the target machine (custom-built, embedded > application). It's also a shame because v3.10's development environment > looks really slick. > > Otherwise, well done GNAT. > > -=Michael Appleby=- > package M is type int is new integer; type flt is new long_float; function "+"(a, b : int) return int; function "+"(a, b : flt) return flt; end M; package body M is function "+"(a, b : int) return int is begin return int(integer(a) + integer(b)); end "+"; function "+"(a, b : flt) return flt is begin return flt(long_float(a) + long_float(b)); end "+"; end M; with M; with Text_IO; procedure Mtest is function "+"(a, b : M.int) return M.int renames M."+"; a, b, c : M.int; begin a := 3; b := 4; c := a + b; Text_IO.put_line( "The value of" & integer'image(integer(a)) & " +" & integer'image(integer(b)) & " =" & integer'image(integer(c)) ); end Mtest;