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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9ce095aba33fe8d0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!news.uni-stuttgart.de!carbon.eu.sun.com!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: Negative float problem Date: Wed, 2 Nov 2005 06:59:03 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1130351574.313991.229420@g14g2000cwa.googlegroups.com> <10mspnley7gzu$.1swtj67sv0ldr$.dlg@40tude.net> <43677dec$1_1@glkas0286.greenlnk.net> NNTP-Posting-Host: host86-131-222-60.range86-131.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com 1130914743 12121 86.131.222.60 (2 Nov 2005 06:59:03 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Wed, 2 Nov 2005 06:59:03 +0000 (UTC) In-Reply-To: X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) Xref: g2news1.google.com comp.lang.ada:6107 Date: 2005-11-02T06:59:03+00:00 List-Id: Robert A Duff wrote: > I wasn't talking about the difference between enums in C++ versus Ada. > I was talking about the difference in overload resolution rules. > Namely that the result type of a function call is used to resolve > in Ada, but not in C++. (And by the way Ada has this weird idea > that enum lits are functions.) I actually rather like this 'weird idea' - it can be very handy with generics: generic type Foo is private; with function Is_A_Bar (F : Foo) return Boolean; procedure Generic_Do_Something (F : Foo); procedure Do_Something is new Generic_Do_Something (Integer, True); -- Integers are always Bars procedure Do_Something is new Generic_Do_Something (Float, False); -- Floats are never Bars procedure Do_Something is new Generic_Do_Something (My_Type, Is_This_A_Bar); -- My_Types are sometimes Bars Cheers -- Martin