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,FREEMAIL_FROM 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!nntp.abs.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Fri, 30 Apr 2004 09:20:42 -0400 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Newbie Ada References: <409243DA.2000906@noos.fr> In-Reply-To: <409243DA.2000906@noos.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1083331242.635316@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1083331242 23532 204.253.250.10 Xref: controlnews3.google.com comp.lang.ada:127 Date: 2004-04-30T09:20:42-04:00 List-Id: Axel Druesnes wrote: > 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. Well, I don't really know Ada, but I think the Ada approach would be to declare those two functions as generic parameters of the package. Then when you instantiate, pass in the correct version of the functions along with the corresponding type. Conceivably you can also make the types of interest tagged types, and use inheritance and dispatching to call the correct versions.