Newbie Ada
From: Axel Druesnes (druesnes.remove_at_noos.fr)
Date: 04/30/04
- Next message: Preben Randhol: "Re: Newbie Ada"
- Previous message: Marius Amado Alves: "[OT] price of doing science (was: No call for Ada...)"
- Next in thread: Preben Randhol: "Re: Newbie Ada"
- Reply: Preben Randhol: "Re: Newbie Ada"
- Reply: Hyman Rosen: "Re: Newbie Ada"
- Reply: Björn Persson: "Type detection"
- Reply: Lutz Donnerhacke: "Re: Newbie Ada"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 14:17:30 +0200
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
- Next message: Preben Randhol: "Re: Newbie Ada"
- Previous message: Marius Amado Alves: "[OT] price of doing science (was: No call for Ada...)"
- Next in thread: Preben Randhol: "Re: Newbie Ada"
- Reply: Preben Randhol: "Re: Newbie Ada"
- Reply: Hyman Rosen: "Re: Newbie Ada"
- Reply: Björn Persson: "Type detection"
- Reply: Lutz Donnerhacke: "Re: Newbie Ada"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|