From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b18ccf7d301fe37,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-19 06:15:04 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: michael.jackson5@virgin.net (Mike) Newsgroups: comp.lang.ada Subject: Invoking abstract subprograms in Ada95 Date: 19 Apr 2002 06:15:03 -0700 Organization: http://groups.google.com/ Message-ID: <2dbd76f3.0204190515.10e6aef0@posting.google.com> NNTP-Posting-Host: 195.166.25.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1019222104 22975 127.0.0.1 (19 Apr 2002 13:15:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 19 Apr 2002 13:15:04 GMT Xref: archiver1.google.com comp.lang.ada:22779 Date: 2002-04-19T13:15:04+00:00 List-Id: 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