comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Ambiguous reference - What is wrong with this?
Date: Tue, 14 Aug 2001 16:10:19 -0400
Date: 2001-08-14T20:10:23+00:00	[thread overview]
Message-ID: <9lc0jf$hod$1@nh.pace.co.uk> (raw)
In-Reply-To: 9lbo1h$2bhq$1@ns.felk.cvut.cz

Hmmmmmm........ I *think* I understand. This may take a bit of pondering.

In any event, it isn't clear how I get out of it considering thatI'd kind of
like to keep the second parameter a 'Class wide type.

I'll have to cogitate on this - but it appears I may not be able to get
there from here. If I'm creating overloadings and qualifying the
overloadings isn't disambiguating them, then it seems the only answer is to
create new names. However doing so means the child class a couple of layers
down can't hide some operation of one of its parents. I'd like to be able to
say my list can only accept elements of some subclass and increasingly
restrict that subclass (see other posts in this thread.) By removing the
'Class qualification, I may avoid the ambiguity, but may not be able to
preserve the subsets I want to have.

Hmmmmmmm............

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Sergey Koshcheyev" <serko84@hotmail.com> wrote in message
news:9lbo1h$2bhq$1@ns.felk.cvut.cz...
>
> It looks to me that the problem is this: when you derive a type from some
> other type, the derived type gets the primitive operations of the parent.
> However, the dispatching parameter type (I'm not sure if it's the correct
> terminology) gets changed from the base type to the derived type. The
> parameter of type 'Class, on the other hand, remains untouched.
> What this leads to is this: when you declare Some_Proc for the Derive1
type,
> it does not override the Some_Proc of Base, but *overloads* it. This means
> that the type Derive1 has *two* primitive operations, and the type Derive2
> has three. They are:
>
> procedure Some_Proc
>   (Object : in out Derive2;
>    Object2 : in out Base'Class);
> procedure Some_Proc
>   (Object : in out Derive2;
>    Object2 : in out Derive1'Class);
> procedure Some_Proc
>   (Object : in out Derive2;
>    Object2 : in out Derive2'Class);
>
> and these are the three operations that the compiler can't choose from. A
> way to overcome this problem would be to rename the Some_Proc you actually
> call to some other name. Qualifying the parameters, like
>          Root.Child1.Some_Proc (
>              Object     => Root.Child1.Derive1 (Object),
>              Object2    => Root.Child1.Derive1'Class'(Object2)) ;
> (note the qualification of Object2) doesn't work.
>






  reply	other threads:[~2001-08-14 20:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-14 15:14 Ambiguous reference - What is wrong with this? Marin David Condic
2001-08-14 16:56 ` Warren W. Gay VE3WWG
2001-08-14 17:45   ` Warren W. Gay VE3WWG
2001-08-14 17:54   ` Marin David Condic
2001-08-14 19:24     ` Warren W. Gay VE3WWG
2001-08-14 17:44 ` Sergey Koshcheyev
2001-08-14 20:10   ` Marin David Condic [this message]
2001-08-15  7:38     ` Sergey Koshcheyev
2001-08-15 13:49       ` Marin David Condic
2001-08-14 20:02 ` tmoran
2001-08-15  6:17   ` Simon Wright
2001-08-17 16:34     ` Marin David Condic
replies disabled

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