comp.lang.ada
 help / color / mirror / Atom feed
From: michael.jackson5@virgin.net (Mike)
Subject: Invoking abstract subprograms in Ada95
Date: 19 Apr 2002 06:15:03 -0700
Date: 2002-04-19T13:15:04+00:00	[thread overview]
Message-ID: <2dbd76f3.0204190515.10e6aef0@posting.google.com> (raw)

Hi

I have a situation whereby I have an abstract class that describes
some common behaviour but which demands that from within that common
behaviour, some abstract behaviour be completed by its children.

In Ada 95 terms I have a package X that contains abstract type Xt and
describes some abstract behaviour "procedure Z". I also have Ada95
Child Package X.Y that contains a non abstract type Yt that extends
and fully completes Xt.

Within package X I have a classwide procedure (actually an XWindows
Callback) that I want to be invoked by all types of child, *but* there
are some specific tasks that can only be completed by the concrete
child (Y in this case) that fully implements procedure Z.

Gnat Ada95 will not let me do this: "Cannot call abstract subprogram"

* Why can I not invoke procedure Z from with package X?

* Why is the tag of the the object passed to procedure Z not being
examined and the call dispatched accordingly?


Given that the object whose root type is Xt can only exist after the
instantiation of Yt (and therefore the provision of procedure Z by my
reckoning) I find this frustrating.

Please help

Mike



             reply	other threads:[~2002-04-19 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-19 13:15 Mike [this message]
2002-04-19 16:18 ` Invoking abstract subprograms in Ada95 Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2002-04-22  4:28 Grein, Christoph
2002-04-22 13:24 ` Mike
2002-04-22 14:24   ` Dmitry A. Kazakov
2002-04-22 13:44 Grein, Christoph
2002-04-23  8:36 ` Mike
2002-04-24  7:32 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