comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Abstract realizations can't be inherited??
Date: 1998/08/27
Date: 1998-08-27T00:00:00+00:00	[thread overview]
Message-ID: <EyDBJB.6JH.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 6s491q$usm$1@nnrp1.dejanews.com

dennison@telepath.com wrote:

: I had a situation today where I wanted to declare a new tagged type which is
: very similar to an existing one I had. Ahh, classic OO. I just derive it from
: the existing type, and redefine the one operation that changed, right? Wrong!

: The existing type's operations that I wanted to inherit are overrides of
: abstract subprograms inherited from its parent type. The compiler blows up
: and points to 3.9.3(6), which appears to say that I have to explicitly
: override every abstract subprogram any "ancestor" type has. 
                                     ^^^
Not "any" ancestor, but rather *the* ancestor specified in the
definition of the type extension.  For a record extension, "the"
ancestor is the direct parent.  For a private extension, "the"
ancestor is the one named in the private extension declaration.

: ... That means that
: if a type is declared abstract, none of the "standard" operations you declare
: for it can ever be inherited! What on earth is the logic behind that
: restriction?

This is not the intent of 3.9.3(6).  It is only talking about the
type from which the subprograms are inherited.  For a record
extension, it is the direct parent.  For a private extension,
it is whatever ancestor is specified.

It would be helpful if you included the relevant source code.  It may
either be that there is a compiler bug, or that the description above 
lacks some critical detail.

: T.E.D.

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  parent reply	other threads:[~1998-08-27  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-27  0:00 Abstract realizations can't be inherited?? dennison
1998-08-27  0:00 ` dewar
1998-08-27  0:00 ` Tucker Taft [this message]
1998-08-28  0:00   ` dennison
1998-08-29  0:00     ` Tucker Taft
1998-08-31  0:00       ` dennison
1998-08-31  0:00         ` Tucker Taft
1998-08-31  0:00           ` dennison
replies disabled

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