comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Barnes vs. Dewar
Date: 1999/08/30
Date: 1999-08-30T00:00:00+00:00	[thread overview]
Message-ID: <wcclnatfmdr.fsf@world.std.com> (raw)
In-Reply-To: 37c6fe0a@news1.us.ibm.net

"Matthew Heaney" <matthew_heaney@acm.org> writes:

> Wow!  I didn't know you could do that.  I just assumed that once private,
> then always private, for all descendents.

Take a look at 7.3.1.  Remember we're talking about a derived type in a
child package here -- when we get to the private part, all kinds of
information about the parent type become magically revealed.  In
particular, we inherit a subprogram.

Now, given that there's an explicit subprogram with the same name and
parameter types, what can we do?  Making it override the implicit one is
really the only sensible answer.

> Good question.  It's bad enough that a controlled operation is public, but
> it's even worse when public-ness only applies to some types in the class.

I don't think it's so horrible.  There might be cases where you want to
call Initialize or Finalize explicitly, so you want to make them public.
And that might apply only to one sub-hierarchy.  So you get the choice
of deriving publicly or privately from Controlled.  Shrug.

Note that if you derive publicly from Controlled, the operations are
visible outside the package, whether or not you overrode them, and
whether or not you put the overridings in the private part.  I think my
previous message might have been misleading on that point...

- Bob
-- 
Change robert to bob to get my real email address.  Sorry.




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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-27  0:00 Barnes vs. Dewar Anton Gibbs
1999-08-27  0:00 ` Robert A Duff
1999-08-27  0:00   ` Matthew Heaney
1999-08-30  0:00     ` Robert A Duff [this message]
1999-08-27  0:00 ` Matthew Heaney
1999-08-29  0:00 ` Robert Dewar
replies disabled

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