From: "Robert C. Leif, Ph.D." <rleif@rleif.com>
To: <comp.lang.ada@ada.eu.org>
Subject: RE: Help me to chose between ADA 95 and C++
Date: 1999/12/15
Date: 1999-12-16T03:49:39+00:00 [thread overview]
Message-ID: <NBBBJNOMKDIAJALCEFIJGELPDGAA.rleif@rleif.com> (raw)
Richard
I was remarking on a standard private type in the specification of a generic
or any other package. If your numeric types are declared in the private part
of a package, you can not set them equal to the literal value of a number,
like 7. Perhaps your solution of using generics would eliminate this
problem. I can not write a subprogram specification to put into a package
specification using ":=" as a function where the formal parameter would be a
universal type. This makes be question how you could create an instantiation
of a generic function to do this.
Yours,
Bob
-----Original Message-----
From: Richard D Riehle [mailto:laoXhai@ix.netcom.com]
Sent: Tuesday, December 14, 1999 7:09 PM
To: comp.lang.ada@ada.eu.org
Subject: RE: Help me to chose between ADA 95 and C++
In article <NBBBJNOMKDIAJALCEFIJOELFDGAA.rleif@rleif.com>,
"Robert C. Leif, Ph.D." <rleif@rleif.com> 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.
>
>
>
>
>
>
next reply other threads:[~1999-12-15 0:00 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-15 0:00 Robert C. Leif, Ph.D. [this message]
1999-12-16 0:00 ` Help me to chose between ADA 95 and C++ Richard D Riehle
1999-12-16 0:00 ` Matthew Heaney
1999-12-17 0:00 ` Richard D Riehle
1999-12-18 0:00 ` Matthew Heaney
1999-12-20 0:00 ` Richard D Riehle
-- strict thread matches above, loose matches on Subject: below --
1999-12-22 0:00 Help me to chose between ADA 95 and C++ ( Ehud Lamm
1999-12-14 0:00 Help me to chose between ADA 95 and C++ Robert C. Leif, Ph.D.
1999-12-15 0:00 ` Richard D Riehle
1999-11-26 0:00 Robert
1999-11-26 0:00 ` Harald Schmidt
1999-11-26 0:00 ` Andreas Winckler
1999-11-26 0:00 ` Florian Weimer
1999-12-04 0:00 ` Richard D Riehle
[not found] ` <01bf3e32$0b9dc880$022a6282@dieppe>
1999-12-10 0:00 ` Chris Powell
1999-12-13 0:00 ` Marin D. Condic
1999-12-13 0:00 ` Richard D Riehle
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Larry Kilgallen
1999-12-15 0:00 ` Robert A Duff
2000-01-12 0:00 ` Richard Pinkall-Pollei
1999-12-14 0:00 ` Ray Blaak
1999-12-14 0:00 ` Richard D Riehle
1999-12-14 0:00 ` Matthew Heaney
1999-12-14 0:00 ` Simon Wright
1999-12-15 0:00 ` Chris Powell
1999-12-15 0:00 ` Robert A Duff
1999-12-15 0:00 ` Ted Dennison
1999-12-20 0:00 ` Stefan Skoglund
1999-12-16 0:00 ` Pascal Obry
1999-12-16 0:00 ` Rakesh Malhotra
1999-12-21 0:00 ` Geoff Bull
1999-12-16 0:00 ` Aidan Skinner
1999-12-16 0:00 ` Lutz Donnerhacke
1999-12-21 0:00 ` Robert Dewar
1999-12-21 0:00 ` Ted Dennison
1999-12-21 0:00 ` Robert Dewar
1999-12-21 0:00 ` Chris Powell
1999-12-13 0:00 ` DuckE
1999-12-14 0:00 ` Matthew Heaney
1999-12-13 0:00 ` Brian Rogoff
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Brian Rogoff
1999-12-14 0:00 ` Preben Randhol
1999-12-14 0:00 ` Stephen Leake
1999-12-14 0:00 ` Tucker Taft
1999-12-15 0:00 ` Stephen Leake
1999-12-15 0:00 ` Preben Randhol
1999-12-15 0:00 ` Richard Pinkall-Pollei
1999-12-15 0:00 ` Richard Pinkall-Pollei
1999-12-21 0:00 ` Geoff Bull
1999-12-21 0:00 ` Tucker Taft
1999-12-22 0:00 ` Ted Dennison
1999-12-14 0:00 ` Matthew Heaney
1999-12-14 0:00 ` Chris Powell
1999-12-14 0:00 ` Matthew Heaney
1999-12-15 0:00 ` Hyman Rosen
1999-12-14 0:00 ` Tucker Taft
1999-12-14 0:00 ` Matthew Heaney
1999-12-23 0:00 ` Chris Powell
1999-12-27 0:00 ` Robert A Duff
1999-12-14 0:00 ` Stephen Leake
1999-12-23 0:00 ` Chris Powell
1999-11-26 0:00 ` Andreas Winckler
1999-11-26 0:00 ` Preben Randhol
1999-11-26 0:00 ` Preben Randhol
1999-11-27 0:00 ` Lionel Draghi
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox