comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Overlaying of methods.
Date: 1997/10/01
Date: 1997-10-01T00:00:00+00:00	[thread overview]
Message-ID: <EHDsGD.7ED@world.std.com> (raw)
In-Reply-To: 34325DA2.41C6@htl-bw.ch


In article <34325DA2.41C6@htl-bw.ch>,
Stefan Muehlebach  <ia94mueh@htl-bw.ch> wrote:
>But what in this example is abmiguous? ...

I think what's confusing you is that you think that the Init operation
is overriding the one that is inherited from the parent type.  That's
not the case in your example, because the two Init's do not have
type-conformant parameter profiles.  So, your type ends up with *two*
things called Init -- one inherited from the parent type, plus a new
one.  If they're visible, then calls will tend to be ambiguous, because
of all the defaults you have.

On the other hand, if you're dispatching via the parent types operation,
that operation will get called, since it is not overridden.

It's hard to understand what's going on without the complete sources --
from what you posted, we can't tell what's visible at the point of the
call to Init.

If what you're trying to do is override the parent's Init procedure,
then just make sure the number and types of parameters (and results, if
any) match.  And parameter modes and subtypes.  (But parameter names and
defaults don't have to match.)

- Bob




  parent reply	other threads:[~1997-10-01  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 [this message]
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
1997-10-01  0:00   ` Robert A Duff
1997-10-01  0:00   ` Stefan Muehlebach
1997-10-01  0:00     ` Jon S Anthony
1997-10-01  0:00       ` Tucker Taft
replies disabled

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