comp.lang.ada
 help / color / mirror / Atom feed
From: Robb.Nebbe@di.epfl.ch (Robb Nebbe)
Subject: Re: Type extension questions
Date: 22 Mar 1995 12:01:40 GMT
Date: 1995-03-22T12:01:40+00:00	[thread overview]
Message-ID: <1995Mar22.125057@di.epfl.ch> (raw)
In-Reply-To: D5tFuE.1vx@ennews.eas.asu.edu

In article <D5tFuE.1vx@ennews.eas.asu.edu>, koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) writes:
|> I have a couple questions on Ada95 tagged types.  These appear to be
|> easy questions, but I can't seem to locate an answer for either.
|> LRM references would also be appreciated with an answer.
|> 
|> 1) Is it possible to derive a type such that the parent operations are not
|>    available to the user of the new type?  This question is equivalent to
|>    the ability to do private inheritance ala C++ - class B: private A { ...};
|>    I would assume the answer is yes, but haven't yet figured out how.

Yes. For example when you need a type to be controlled typically you don't
want to expose the finalize, initialize and adjust operations to the client
so you write:

	package P is

	    type T is private;

	private

	    type T is new Ada.Finalization.Controlled with ...

	    procedure Adjust( Object : in out T );

	    ...

	end P;

A private_type_declaration must be completed with a
full_type_declaration which is in 3.2.1

Robb Nebbe



  reply	other threads:[~1995-03-22 12:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-22  0:25 Type extension questions Harry Koehnemann
1995-03-22 12:01 ` Robb Nebbe [this message]
1995-03-23 22:05   ` Harry Koehnemann
1995-03-25  6:59     ` Cyrille Comar
1995-03-25  7:13     ` Cyrille Comar
1995-03-27  0:00       ` Norman H. Cohen
1995-03-30  0:00         ` Cyrille Comar
1995-03-27 17:29       ` Harry Koehnemann
1995-03-27 20:26         ` Robert I. Eachus
1995-03-29  0:00           ` Harry Koehnemann
1995-03-27 20:37         ` Kennel
1995-03-23 22:03 ` 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