comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria.organon.com (Jon S Anthony)
Subject: Re: Overlaying of methods.
Date: 1997/09/30
Date: 1997-09-30T00:00:00+00:00	[thread overview]
Message-ID: <JSA.97Sep30175102@alexandria.organon.com> (raw)
In-Reply-To: 34310F93.41C6@htl-bw.ch


In article <34310F93.41C6@htl-bw.ch> Stefan Muehlebach <ia94mueh@htl-bw.ch> writes:

>   type XaCrowColumn     is new XaContainer with private;
>   type XaCrowColumn_Ptr is access all XaCrowColumn'class;
>   procedure Init(o           : access XaCrowColumn;
>                  parent      : access XaApplication'class;
>                  orientation : ...;
>                  num_cols    : Integer := 1;
>                  adjust_last : Boolean := True);
> 
> (XaApplication is the parent class for all classes in my library)
> 
> Part of the second package (which uses the one above):
> 
>   type XaCradioBox     is new XaCrowColumn with private;
>   type XaCradioBox_Ptr is access all XaCradioBox'class;
>   procedure Init(o           : access XaCradioBox;
>                  parent      : access XaApplication'class;
>                  orientation : ...;
>                  num_cols    : Integer := 1);
> 
> In the main program I declare a new object the following way:
> 
>   myRadioBox: XaCradioBox_Ptr := new XaCradioBox;
> 
> BUT - and that is the frustrating point - if I write a statement like
> this
> 
>   Init(myRadioBox, aParent, anOrientation);

type XaCradioBox has two overloaded Init procedures (3.2.3 & 3.4): the
one inherited from it's parent with the "adjust_last" in its signature
(implicitly declared) and the one explicitly declared on it without
"adjust_last" in its signature.  Either of these can be invoked on
myRadioBox.  Perhaps more to the point, either of these can be chosen
to determine the runtime dispatch resolution.  Which of these is
chosen for this is a compile time overload resolution.

Off the top of my head, the call looks like it should give a compile
time ambiguous overload resolution error.  If this isn't true, could
Robert, Bob or Tucker explain why it is OK?

/Jon
-- 
Jon Anthony
STL, Belmont, MA 02178, 617.484.3383 
"Nightmares - Ha!  The way my life's been going lately,
 Who'd notice?"  -- Londo Mollari




  parent reply	other threads:[~1997-09-30  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-30  0:00 Overlaying of methods Stefan Muehlebach
1997-09-30  0:00 ` Tom Moran
1997-10-01  0:00   ` Stefan Muehlebach
1997-10-01  0:00     ` Tom Moran
1997-10-01  0:00     ` Robert A Duff
1997-10-07  0:00       ` Stefan M=?iso-8859-1?Q?=FChlebach
1997-10-07  0:00         ` Jon S Anthony
1997-09-30  0:00 ` Jon S Anthony [this message]
1997-10-01  0:00   ` Stefan Muehlebach
1997-10-01  0:00     ` Jon S Anthony
1997-10-01  0:00       ` Tucker Taft
1997-10-01  0:00   ` Robert A Duff
replies disabled

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