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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dda6cdc6d53fb10d X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stueberl.de!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Newbie Ada Date: Fri, 30 Apr 2004 14:49:28 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <409243DA.2000906@noos.fr> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1083336568 18046 217.17.192.37 (30 Apr 2004 14:49:28 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Fri, 30 Apr 2004 14:49:28 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: controlnews3.google.com comp.lang.ada:136 Date: 2004-04-30T14:49:28+00:00 List-Id: * Axel Druesnes wrote: > 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 ) > > function Type_Id ( Value : in Boolean ) return E_Type_Id; > function Type_Id ( Value : in Integer ) return E_Type_Id; You don't need this. > -- Inside the body > procedure I_Need_The_Type ( Value : Generic_Type ) First variant: You like to declare and define this function internally. generic type Generic_Type(<>) is limited private; package XXX is procedure I_Need_The_Type (Value : Generic_Type); end XXX; package body XXX is procedure I_Need_The_Type (Value : Generic_Type) is begin null; end I_Need_The_Type; end XXX; Second variant: You need to call an external function of this type. generic type Generic_Type(<>) is limited private; with procedure I_Need_The_Type (Value : Generic_Type); package XXX is procedure Doit (x : Generic_Type); end XXX; package body XXX is procedure Doit (x : Generic_Type) is begin I_Need_The_Type(x); end Doit; end XXX; Have fun.