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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-30 06:48:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!news-out.newsfeeds.com!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!ken-transit.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!not-for-mail From: Dale Stanbrough Newsgroups: comp.lang.ada Subject: Re: Saturated Math References: <3ECFF541.1010705@attbi.com> <3ED0B820.5050603@noplace.com> <3ED2096F.3020800@noplace.com> <3ED353BE.40605@noplace.com> <3ED4A323.3000909@noplace.com> <3ED5E8DE.8070308@noplace.com> User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Message-ID: Date: Fri, 30 May 2003 13:46:10 GMT NNTP-Posting-Host: 144.132.47.50 X-Complaints-To: abuse@bigpond.net.au X-Trace: news-server.bigpond.net.au 1054302370 144.132.47.50 (Fri, 30 May 2003 23:46:10 EST) NNTP-Posting-Date: Fri, 30 May 2003 23:46:10 EST Organization: BigPond Internet Services (http://www.bigpond.net.au) Xref: archiver1.google.com comp.lang.ada:38093 Date: 2003-05-30T13:46:10+00:00 List-Id: AG wrote: > "Dale Stanbrough" wrote in message > news:dstanbro-C01C2E.20545030052003@mec2.bigpond.net.au... > > AG wrote: > > > > In this case, the problem seems to be that the compiler > > > (quite rightly) can't tell which "+" you mean since there > > > are, in fact, two implementations visible at that spot. > > > > yes, i agree. But i think that's the problem of user defined > > saturation maths packages. (unless someone can come up with a > > different solution). > > Sorry, but have you missed the first part of my post > (which you snipped) where I provided an example > of that? The comment about ambiguous "+" was just > an after-thought to comment on just why yours > doesn't work. Ah, yes i did. Sorry, but I was in the middle of marking assignments, and was using c.l.a. as a welcome distraction... I don't like the idea that you have to create a dummy type... type Pretend_Type is new Integer range 1..5; package Saturated_Int is new Saturate (Pretend_Type); ... It seems a bit clunky just to get around the type system. I thought of passing in an upper and lower bound to the generic, but what type should they be? You could make them integer, but what if you wanted saturating integers with a larger range than Standard.Integer? Dale