comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: Newbie Ada
Date: Fri, 30 Apr 2004 09:20:42 -0400
Date: 2004-04-30T09:20:42-04:00	[thread overview]
Message-ID: <1083331242.635316@master.nyc.kbcfp.com> (raw)
In-Reply-To: <409243DA.2000906@noos.fr>

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.



  parent reply	other threads:[~2004-04-30 13:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-30 12:17 Newbie Ada Axel Druesnes
2004-04-30 12:22 ` Preben Randhol
2004-04-30 13:20 ` Hyman Rosen [this message]
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
replies disabled

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