comp.lang.ada
 help / color / mirror / Atom feed
* Re: 'Digit in generic package
@ 1996-08-26  0:00 W. Wesley Groleau (Wes)
  1996-08-27  0:00 ` Robert I. Eachus
  1996-08-27  0:00 ` Ken Garlington
  0 siblings, 2 replies; 4+ messages in thread
From: W. Wesley Groleau (Wes) @ 1996-08-26  0:00 UTC (permalink / raw)



R. A. O'Keefe asked
[how to make a generic use the most precise type out of its actuals]

R. Eachus answered

  [Write the generic body to dispatch at run-time]

At least one vendor supplied a generic math package that did exactly
that AND on examining the disassembled code for an instantiation, we
found that the compiler had looked at the parameters and eliminated
the "dead code" so that the effect was exactly what Mr. O'Keefe had
asked for.

Now I wonder whether in Ada 95 it would work to simplify R. Eachus's
suggestion with

   ...
   function Generic_F ... is

      Precision : constant := Max(Foo'Digits,Bar'Digits,...);

   begin
      case Precision is ...

--
---------------------------------------------------------------------------
W. Wesley Groleau (Wes)                                Office: 219-429-4923
Hughes Defense Communications (MS 10-40)                 Home: 219-471-7206
Fort Wayne,  IN   46808                  (Unix): wwgrol@pseserv3.fw.hac.com
---------------------------------------------------------------------------




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-08-28  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-26  0:00 'Digit in generic package W. Wesley Groleau (Wes)
1996-08-27  0:00 ` Robert I. Eachus
1996-08-28  0:00   ` Robert Dewar
1996-08-27  0:00 ` Ken Garlington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox