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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6b6619eb9cada212 X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: RE: Help me to chose between ADA 95 and C++ Date: 1999/12/15 Message-ID: <83707n$npi$1@nntp8.atl.mindspring.net>#1/1 X-Deja-AN: 560809842 References: Organization: MindSpring Enterprises X-Server-Date: 15 Dec 1999 03:00:07 GMT Newsgroups: comp.lang.ada Date: 1999-12-15T03:00:07+00:00 List-Id: In article , "Robert C. Leif, Ph.D." wrote: >From: Bob Leif >To: Richard Riehle et al. >How do you set an instantiation equal to a universal integer or >universal_real? I tried to do this with a 32 bit data type and had to define >a non_private type for simple operations like >Data_32 : Data_32_Type := 7; >I then converted from the non_private to the private (Ugly). Robert, A universal integer is not a defined type. You would want to declare a type to accomplish instantiation using my generic example. It cannot be instantiated with a universal integer or a universal float since it is a private type formal parameter. I am not sure whether I actually answered your question. Perhaps someone else will have a different reading of it. Regards, Richard -- =========== Code from my earlier post follows ================= >generic > type Number is private; > with function "+" (L, R : Number) return Number is <>; > -- all other operators similarly declared as generic parameters >package Generic_Operators is end Generic_Operators; > >with Generic_Operators; >generic > with package Operators is new Generic_Operators (<>); >package Statistics is > ... >end Statistics; > >which allows instantiation with any numeric type. Also, there is a >way to instantiate this with a non-numeric type that I published in >an Ada Letters a couple of years ago. > >So, on this point, Chris, I am pretty much in agreement with you. > >Richard Riehle > > P.S. I apologize if my earlier reply was a bit to harsh. > > > > > >