comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Dispatching with a child for a parameter? (was: Freezing question)
Date: 1999/07/19
Date: 1999-07-19T00:00:00+00:00	[thread overview]
Message-ID: <7mvp5p$37b$1@nnrp1.deja.com> (raw)
In-Reply-To: 379347D8.A902583C@averstar.com

In article <379347D8.A902583C@averstar.com>,
  Tucker Taft <stt@averstar.com> wrote:
> Ted Dennison wrote:
> > Ahhh. I bet that's it. Does that mean that in the example above,
Apple
> > will inherit *none* of Fruit's operations, since none of them were
> > declared before Apple?
>
> Correct.  See 7.3.1(7).


Ahhh. OK. So I'll ask the next question (with the topic appropriately
renamed:

How would one implement a hierarchy where one object has dispatching
operations that take a specific one of its chilren types as parameters?
I'm running out of ideas.

eg:

   type Widget is abstract tagged private;
   type Container is abstract new Widget with private;

   procedure Add
      (Child  : in out Widget;
       Parent : in out Container'Class
      );

Won't quite work because Add won't be inherited by any Containers unless
it is placed before the declaration of Container. But if I move it
between the two declarations, it won't compile because Container won't
have been declared yet.

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-07-19  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-15  0:00 Freezing question Ted Dennison
1999-07-15  0:00 ` Tucker Taft
1999-07-16  0:00   ` Ted Dennison
1999-07-19  0:00     ` Tucker Taft
1999-07-19  0:00       ` Ted Dennison [this message]
1999-07-19  0:00       ` Ted Dennison
1999-07-19  0:00         ` Robert I. Eachus
1999-07-20  0:00           ` Ted Dennison
replies disabled

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