From: "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>
Subject: Re: OO in Ada
Date: Tue, 08 Oct 2002 13:16:49 -0400
Date: 2002-10-08T13:16:49-04:00 [thread overview]
Message-ID: <3DA31301.80506@cogeco.ca> (raw)
In-Reply-To: uq5uu7e7rc623a@corp.supernews.com
Matthew Heaney wrote:
> "John McCabe" <john.nospam@nospamassen.nospamdemon.co.uk> wrote in message
> news:3da2aafd.7023559@news.demon.co.uk...
...
>>>:) However, if in a program 'use'ing the child package of 'Thick_Pen'
>>
> (and
>>>not mentioning the base package of 'Pen') I make a call to the routine
>>>'Draw' with an actual parameter of the type 'Pen' I get a compiler error
>>>message to the effect that 'Draw' is not visible. In other words,
>>
> Thick_Pen
>
>>>has not inherited the operation Draw for 'Pen' Again,
>>>_there_is_no_inheritace_.
>>
>>There is an easy answer to this that I can't remember at the moment.
>>It's probably to do with using 'Class somewhere, but it may be that
>>you have an incorrect declaration somewhere that isn't actually a
>>creating a dispatching operation.
I believe that the problem referred to here is simply one
of a visibility. Either a 'use' or a fully qualified call is
required. If I understand correctly, you're saying you have
some parent package "Pen", and a child package "Thick_Pen",
and you use the package as in:
use Pen.Thick_Pen;
...
Draw(...); -- Compile error because Draw is defined in Pen
This is solved either by doing something like:
use Pen, Pen.Thick_Pen;
...
Draw(...); -- OK now, because Pen.Draw is visible.
or qualifying by your call as in:
use Pen.Thick_Pen;
...
Pen.Draw(...);
Warren.
--
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg
next prev parent reply other threads:[~2002-10-08 17:16 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-04 2:14 OO in Ada Rick Duley
2002-10-04 2:55 ` Jim Rogers
2002-10-04 17:35 ` Hyman Rosen
2002-10-05 0:20 ` Jim Rogers
2002-10-05 23:38 ` Dmitry A.Kazakov
2002-10-05 15:25 ` Jim Rogers
2002-10-06 21:37 ` Dmitry A.Kazakov
2002-10-06 2:18 ` Hyman Rosen
2002-10-06 3:00 ` Jim Rogers
2002-10-08 21:08 ` Gisle Sælensminde
2002-10-04 3:37 ` Chad R. Meiners
2002-10-04 5:32 ` Simon Wright
2002-10-04 6:01 ` tmoran
2002-10-04 15:05 ` Matthew Heaney
2002-10-05 2:14 ` SteveD
2002-10-05 8:54 ` Preben Randhol
2002-10-07 14:10 ` Matthew Heaney
2002-10-07 19:52 ` Jeffrey Carter
2002-10-08 21:18 ` Dmitry A.Kazakov
2002-10-08 9:53 ` John McCabe
2002-10-08 15:37 ` Matthew Heaney
2002-10-08 16:47 ` Georg Bauhaus
2002-10-08 17:48 ` Matthew Heaney
2002-10-08 17:16 ` Warren W. Gay VE3WWG [this message]
2002-10-08 17:58 ` Matthew Heaney
2002-10-09 16:59 ` Warren W. Gay VE3WWG
2002-10-08 10:21 ` Preben Randhol
-- strict thread matches above, loose matches on Subject: below --
1998-05-15 0:00 Gisle S{lensminde
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox