comp.lang.ada
 help / color / mirror / Atom feed
* Newbie Ada
@ 2004-04-30 12:17 Axel Druesnes
  2004-04-30 12:22 ` Preben Randhol
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Axel Druesnes @ 2004-04-30 12:17 UTC (permalink / raw)


Hi there,

  i am currently writing a generic package. Despite being really generic 
one (at least) particular type need a special handling in two functions. 
I am therefore wondering how i can either detect the type... So far i 
thought of calling an overloaded function with a variable of the generic 
type as a parameter which would return a special identifier for this 
type but Ada doesn't allow me to call the said function as it consider 
the generic type to be a type of itself instead of a placeholder for the 
real type before the generic package is specialized.

Any suggestion about how i could call a function with the generic type 
as a parameter without creating errors ? Other ways to detect types is 
welcolme ( i can't use an enumeration value in place of a type in this 
case )

ex:

function Type_Id ( Value : in Boolean ) return E_Type_Id;
function Type_Id ( Value : in Integer ) return E_Type_Id;

-- Inside the body
procedure I_Need_The_Type ( Value : Generic_Type )
...
Type_Identifier := Type_Id ( Value ); -- i wish it worked here

Axel Druesnes




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

end of thread, other threads:[~2004-05-02 13:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-30 12:17 Newbie Ada Axel Druesnes
2004-04-30 12:22 ` Preben Randhol
2004-04-30 13:20 ` Hyman Rosen
2004-04-30 13:54 ` Type detection Björn Persson
2004-04-30 15:04   ` Marius Amado Alves
2004-05-01  0:28   ` Robert I. Eachus
2004-05-01  5:01     ` James Rogers
2004-05-01  7:12       ` Robert I. Eachus
2004-05-01 12:43       ` Björn Persson
2004-05-01 12:42     ` Björn Persson
2004-04-30 14:49 ` Newbie Ada Lutz Donnerhacke
2004-05-02 13:33 ` Stephen Leake

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