comp.lang.ada
 help / color / mirror / Atom feed
From: "Ehud Lamm" <mslamm@huji.ac.il>
Subject: Re: class wide object in generic package
Date: Tue, 11 Jun 2002 22:57:11 +0200
Date: 2002-06-11T22:57:11+02:00	[thread overview]
Message-ID: <ae5kus$381$1@news.iucc.ac.il> (raw)
In-Reply-To: wkelffffuy.fsf@acm.org

"Stephen Leake" <stephen_leake@acm.org> wrote in message
news:wkelffffuy.fsf@acm.org...
> Thomas Maier-Komor <maierkom@rcs.ei.tum.de> writes:
>
>
> If you want dispatching, you'll have to use a generic formal package
> parameter:
>
> generic
>    package Object_Package is new Generic_Obj_Package (...);
> package generic_pac ...
>

It seems to me you want as a generic paramter any type that has the Eval
operation.
So you can define a parent type having this operation (say an abstract type
called Evalable).
Now you can define the generic

with Evalable_Pak;
generic
    type My_Evalable is new Evalable_Pak.Evalable with private;
....

My_Evalable will have a primitive Eval operation.

(Hope I am not making a fool of myself here. I confess not compiling a real
example.)

Ehud Lamm
(Stay tuned to the results of the Ada-Europe'2002 Workshop on a Standard
Container Library for Ada!)






  parent reply	other threads:[~2002-06-11 20:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10  7:38 class wide object in generic package Thomas Maier-Komor
2002-06-10 12:28 ` Craig Carey
2002-06-10 13:14   ` Thomas Maier-Komor
2002-06-10 13:00 ` Stephen Leake
2002-06-10 13:25   ` Thomas Maier-Komor
2002-06-11 20:57   ` Ehud Lamm [this message]
2002-06-12 17:33     ` Stephen Leake
2002-06-13  1:58       ` Robert A Duff
2002-06-13 14:07         ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2002-06-10 11:07 Grein, Christoph
replies disabled

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