comp.lang.ada
 help / color / mirror / Atom feed
From: "Anthony E. Glover" <aeg@hiwaay.net>
Subject: Re: How to?: Re-dispatching within an inherited method
Date: 1999/08/18
Date: 1999-08-18T00:00:00+00:00	[thread overview]
Message-ID: <37BB74A8.F35560F7@hiwaay.net> (raw)
In-Reply-To: 37bae808@news1.us.ibm.net

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

In my case, I am using pointers to objects; so, I actually have to
'use' all derived type packages and then make the procedure call
without full dot notation, such as:

use A;
use B;

...
...

    Run_Widget( UnknownWidget.all );

Where UnknownWidget is a pointer to the class wide type.
Is there a better way of doing this?  If I add a new
package with another derived type, then I have to go
add 'uses' to all packages that make calls to methods
of the class.

Tony


Matthew Heaney wrote:
> 
> In article <7pcar9$aeg@hobbes.crc.com> , "David C. Hoos, Sr."
> <david.c.hoos.sr@ada95.com> wrote:
> 
> > Without a class-wide Run_Widget, however, the call to
> > Run_Widget with an actual parameter of type BigWidget is
> > illegal -- a type conversion is required there.
> >
> 
> Yes, but that's because you used expanded name notation:
> 
>   A.Run_Widget (The_BigWidget);  -- illegal
> 
> If you want to call the version of the operation that's primitive for
> BigWidget, then you have to name the correct operation:
> 
>   B.Run_Widget (The_BigWidget);
> 
> No type conversion is required.
> 
> >> With the change, you can say:
> >>
> >>   B.Run_Widget (The_BigWidget);
> >>
> >> and all is well.
> --
> Matt
> 
> It is impossible to feel great confidence in a negative theory which has
> always rested its main support on the weak points of its opponent.
> 
> Joseph Needham, "A Mechanistic Criticism of Vitalism"

[-- Attachment #2: Card for Anthony E. Glover --]
[-- Type: text/x-vcard, Size: 361 bytes --]

begin:vcard 
n:Glover;Anthony E.
tel;fax:256-721-1816
tel;home:256-837-7017
tel;work:256-721-7714 X249
x-mozilla-html:FALSE
url:www.elmco.com
org:ELMCO, Inc.
version:2.1
email;internet:aeg@hiwaay.net
title:Senior Software Engineer
adr;quoted-printable:;;6000 Technology Drive=0D=0ASuite N;Huntsville;AL;35805;USA
x-mozilla-cpt:;1
fn:Anthony E. Glover
end:vcard

  reply	other threads:[~1999-08-18  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-09  0:00 How to?: Re-dispatching within an inherited method Anthony E. Glover
1999-08-09  0:00 ` David C. Hoos, Sr.
1999-08-17  0:00   ` Matthew Heaney
1999-08-17  0:00     ` David C. Hoos, Sr.
1999-08-18  0:00       ` Matthew Heaney
1999-08-18  0:00         ` Anthony E. Glover [this message]
1999-08-19  0:00           ` Matthew Heaney
1999-08-21  0:00             ` Anthony E. Glover
replies disabled

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