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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-16 19:54:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Thu, 16 Jan 2003 20:03:55 -0800 Organization: AdaWorks Software Engineering Message-ID: <3E2780AB.23BDD226@adaworks.com> References: <1041908422.928308@master.nyc.kbcfp.com> <1041997309.165001@master.nyc.kbcfp.com> <1042086217.253468@master.nyc.kbcfp.com> <1042477504.547640@master.nyc.kbcfp.com> <1042651417.215661@master.nyc.kbcfp.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.48.2b Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 17 Jan 2003 03:54:43 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:33113 Date: 2003-01-17T03:54:43+00:00 List-Id: "Dmitry A. Kazakov" wrote: > They are not, up to some limit. But the problem is whether the language > gives you an opportunity to define new numeric types without the > restrictions you do not need and close enough to the theoretical > performance limit for the remaining restrictions. Ada almost can this. > [Almost, because one cannot make a private type "numeric" for the > compiler.] In fact, I have a generic package, for creating generic formal package parameters that looks like this: generic type Item is private; with function "+" (L, R : Item) return Item is <>; with function "-" (L, R : Item) return Item is <>; with function "*" (L, R : Item) return Item is <>; with function "/" (L, R : Item) return Item is <>; with function "=" (L, R : Item) return Boolean is <>; with function "<" (L, R : Item) return Boolean is <>; with function ">" (L, R : Item) return Boolean is <>; with function "<=" (L, R : Item) return Boolean is <>; with function ">=" (L, R : Item) return Boolean is <>; with function Zero_Equivalent return Item; -- with some additional generic formal subprogram parameters package Generic_Operators is end Generic_Operators; This can be used in some other package as a generic formal package parameter. generic with package Operators is new Generic_Operators<>; package Generic_Statistics is -- Any data type here end Generic_Statistics; I published an article with the details for this in an old issue of Ada Letters. Richard Riehle